|
-
Apr 22nd, 2004, 09:58 AM
#1
Addicted Member
I forgot to mention....
When you are in the 'Form Builder', at the top of the window are two drop down listboxes.
The left one shows all available objects, including the form object itself. The right one shows a list of all event triggers you can use.
Once you play with it for awhile, you can just type the "Sub MyObject_(event)" subroutine definitions yourself.
Like the second example I typed above, the best thing to do is to call a form from a sub-routine in a module and then refer to the objects on the form after it has closed (form1.mytextbox.text).
Probably the best thing is if you have some input boxes and a button on the form like "go"
When you hide a form (form1.hide), the program will pick up right after the call that broght the form up.
(module1)
Sub MySub
Form1.show
'Form1 is visible
'When the user click a 'finish' button the form hides itself
'When the form hides itself the code picks back up here.....
Cells(1,2).value = Form1.mytextbox.text
If Form1.MyRadioButton1.value = True then Cells(1,3).value = "true"
End MySub
Another thing to mention is that if you need things to be done as soon as the form opens, in the form code you can use the "activate" event.
Sub UserForm1_Activate ()
'Do some stuff
End Sub
For example, you might want to load some listboxes or something on the form as soon as it opens.
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
|