|
-
Jun 2nd, 2005, 05:22 PM
#1
Thread Starter
Member
Invoking a form from a command button [Resolved]
Hi,
I'm trying to write code for a form that contains different command buttons. When a command button is pressed i want it to open another form which then gives the user to select options/checks from the form. I am not sure though how to do this?? I have looked at different VB books and all of them so far have only shown bringing up a message box prompt after a command button is pressed?? How can i bring up another form that lists options/check boxes/labels?????
Am stuck
Thanks.
Last edited by chaos7; Jun 2nd, 2005 at 06:47 PM.
-
Jun 2nd, 2005, 05:49 PM
#2
Re: Invoking a form from a command button
 Originally Posted by chaos7
Hi,
I'm trying to write code for a form that contains different command buttons. When a command button is pressed i want it to open another form which then gives the user to select options/checks from the form. I am not sure though how to do this?? I have looked at different VB books and all of them so far have only shown bringing up a message box prompt after a command button is pressed?? How can i bring up another form that lists options/check boxes/labels?????
Am stuck
Thanks.
Its amazing how much of a pain this can be and its only one line of code...
Put that in the buttons click event handler and your done 
Cheers,
RyanJ
-
Jun 2nd, 2005, 06:18 PM
#3
Thread Starter
Member
Re: Invoking a form from a command button
hi ryan,
i placed the code as below;
Private Sub CommandButton1_Click()
frmUserFormName.Show
End Sub
but it came up with a "Variable not defined" error when i pressed the button??? sorry..am still a starter in VB..
thanks
-
Jun 2nd, 2005, 06:20 PM
#4
Re: Invoking a form from a command button
 Originally Posted by chaos7
hi ryan,
i placed the code as below;
Private Sub CommandButton1_Click()
frmUserFormName.Show
End Sub
but it came up with a "Variable not defined" error when i pressed the button??? sorry..am still a starter in VB..
thanks
In the code you need to replace frmUserFormName with the name of your UserForm 
Cheers,
RyanJ
-
Jun 2nd, 2005, 06:21 PM
#5
Thread Starter
Member
Re: Invoking a form from a command button
oh i figured it out - i didnt put the form name in
thanks for ur help
-
Jun 2nd, 2005, 06:29 PM
#6
Re: Invoking a form from a command button
 Originally Posted by chaos7
oh i figured it out - i didnt put the form name in
thanks for ur help 
You are wleocme 
If your question has been solved then please edit yout original post. Please change its icon to the green checkmark and add Resolved to the potsts title so everyone know this threads has been resolved 
Cheers,
RyanJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|