Microsoft Office Tutorials and References
In Depth Information
Changing the Way Your Form Looks Dynamically
Figure 2-6:
You set
the On
for your
button to the
you want
the button to
Book VI
Chapter 2
Changing the Way Your Form Looks Dynamically
A really smart form changes in response to the information you type in it.
Making smart forms isn’t hard: You need only know how to make a macro
display, hide, enable, or disable controls on the form in response to what
you enter.
Setting the properties of form controls
Macros have no problem changing the values of controls; a macro can copy
a value from one control to another, for example, or store a calculation in
a control by using the SetValue action. But that’s not all. Macros can also
change the properties of controls, in essence changing how controls look
or act onscreen. The following properties, for example, are all eminently
changeable when a macro gets its hands on them:
Fore Color: We’re guessing that Fore Color is short for Foreground
Color. In any event, Fore Color refers to the text-color property of a
label. Changing this property makes the text appear in a different color.
Why is this property neat? A macro can change the color of a label to,
say, bright red if an order isn’t paid for, which makes tracking down
deadbeats much easier for you. Back Color works the same way for
the background color.
Visible: If the Visible property is set to No, the control is hidden.
You can have a macro make controls invisible based on the values of
other controls. If an order is paid by check, for example, the credit-card
controls aren’t needed and can be hidden.
Enabled: If the Enabled property is set to No, the cursor won’t move to
it, and you can’t change the control’s value. You can make a macro that
sets the value of some controls and then disables them so that the value
can’t be changed.
Search JabSto ::

Custom Search