|Access Developer Reference|
expression A variable that represents a TextBox object.
You can use this property for controls on forms or reports to make them easy to read or to convey a special meaning. For example, you can change the color of the text in the UnitsInStock control when its value falls below the reorder level.
You can also use this property on reports to create special visual effects when you print with a color printer. When used on a report, this property specifies the printing and drawing color for the Print , Line , and Circle methods.
The ForeColor property contains a numeric expression that represents the value of the text color in the control.
You can use the Color Builder to set this property by clicking the Build button to the right of the property box in the property sheet. Using the Color Builder enables you to define custom colors for text in controls.
You can set the default for this property by using a control's default control style or the DefaultControl property in Visual Basic.
For reports, you can set the Circle property only by using a macro or a Visual Basic event procedure specified in a section's OnPrint event property setting.
The following example uses the RGB function to set the BorderColor, BackColor, and ForeColor properties depending on the value of the
txtPastDue text box. You can also use the QBColor function to set these properties. Putting the following code in the Form_Current( ) event sets the control display characteristics as soon as the user opens a form or moves to a new record.
|Visual Basic for Applications|