Microsoft Office Tutorials and References
In Depth Information
Try It
To summarize the difference between Unload and Hide , the method you choose
will depend on why you don’t want the UserForm to be seen. Most of the time,
you’ll want the form cleared from memory, but sometimes, information that was
entered into the form needs to be referred to the next time you show the form
while the workbook has remained open. Closing the workbook automatically
unloads a UserForm only if it was hidden.
Try iT
In this lesson, you design a simple UserForm with a Label control, a TextBox control, a CheckBox
control, and two CommandButton controls.
lesson requirements
For this lesson, you practice designing a simple UserForm with various controls to emulate a client
profile. To get the sample database files you can download Lesson 18 from the book’s website at
www.wrox.com .
step-by-step
1.
Press Alt+F11 to go to the Visual Basic Editor.
2.
Select the workbook name in the Project Explorer window, and from the menu at the top of
the VBE click Insert UserForm.
3.
Select the UserForm in its design window, and press the F4 key (or click View Properties
Window) to show the Properties window.
4.
Change the Name property to frmClients and change the Caption property to Clients .
5.
Size the UserForm by setting its Height property to 240 and its Width property to 190.
6.
From the menu at the top of the VBE, click View Toolbox.
7.
From the Toolbox, click the Label control icon and draw a Label across the top of the
UserForm. With the Label control selected, change its Caption property to Company Name .
8.
From the Toolbox, click the TextBox control icon and draw a TextBox directly below the
Label.
9.
From the Toolbox, click the Label control icon again, and draw a Label a little bit below the
TextBox. With that Label control selected, change its Caption property to Client’s business
— check all that apply: .
10.
Directly below the Label from Step 9, from the Toolbox, click the CheckBox control
icon and draw a CheckBox that is wide enough for you to have its caption property be
“Agriculture.”
 
 
Search JabSto ::




Custom Search