Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 132,151 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,869 people online right now. Registration is fast and FREE... Join Now!




Need Help with (VBA) Ms. Word

 
Reply to this topicStart new topic

Need Help with (VBA) Ms. Word

PRC
post 4 Oct, 2008 - 07:02 PM
Post #1


New D.I.C Head

*
Joined: 1 Apr, 2008
Posts: 3

Hi ,

i'm trying to write a code in Word VBA, that should let the command button open another form. i have tried the following:

CODE
form.open=new form.form2
form2.show


however when i rum it, an error pops up saying that the user defined type not defined.

how can i fix this problem? can anyone pls tell me how i can get the commandbutton to open the form

Thanx

User is offlineProfile CardPM

Go to the top of the page

akhileshbc
post 4 Oct, 2008 - 10:26 PM
Post #2


D.I.C Head

Group Icon
Joined: 26 Sep, 2008
Posts: 177



Thanked 3 times

Dream Kudos: 50
My Contributions


Try this:
load form2
form2.Show
User is offlineProfile CardPM

Go to the top of the page

PRC
post 4 Oct, 2008 - 10:48 PM
Post #3


New D.I.C Head

*
Joined: 1 Apr, 2008
Posts: 3

QUOTE(akhileshbc @ 4 Oct, 2008 - 11:26 PM) *

Try this:
load form2
form2.Show



Now it gives me a run time error " 424" and says 'object required'
User is offlineProfile CardPM

Go to the top of the page

akhileshbc
post 4 Oct, 2008 - 10:56 PM
Post #4


D.I.C Head

Group Icon
Joined: 26 Sep, 2008
Posts: 177



Thanked 3 times

Dream Kudos: 50
My Contributions


whick line is howing that error.?
form2 is the name of the form. I think the Load command is causing this error(its for vb6). just try the only line:

Form2.Show

Remember, Form2 is the name of the form you want to show... smile.gif
User is offlineProfile CardPM

Go to the top of the page

PRC
post 4 Oct, 2008 - 11:01 PM
Post #5


New D.I.C Head

*
Joined: 1 Apr, 2008
Posts: 3

QUOTE(akhileshbc @ 4 Oct, 2008 - 11:56 PM) *

whick line is howing that error.?
form2 is the name of the form. I think the Load command is causing this error(its for vb6). just try the only line:

Form2.Show

Remember, Form2 is the name of the form you want to show... smile.gif


same error appears, now for form2.show line
User is offlineProfile CardPM

Go to the top of the page

akhileshbc
post 5 Oct, 2008 - 12:39 AM
Post #6


D.I.C Head

Group Icon
Joined: 26 Sep, 2008
Posts: 177



Thanked 3 times

Dream Kudos: 50
My Contributions


i have no experience with vbscript-macro. But only in vb6. So you better wait and listen what others have to say.... smile.gif
User is offlineProfile CardPM

Go to the top of the page

thava
post 5 Oct, 2008 - 12:56 AM
Post #7


D.I.C Regular

Group Icon
Joined: 17 Apr, 2007
Posts: 424



Thanked 17 times

Dream Kudos: 50
My Contributions


not mush more difference that vb6 and vba little bit

ok
what is your form name is the form name is form2 then check the following else change the form2 to your form name
did you have any code in form_load event or form_activate event then check that code is correct if all are right then verify that form is in your macro project if not add it that's all your error will be cleared

This post has been edited by thava: 5 Oct, 2008 - 12:58 AM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 01:34PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month