you're not understanding what i said, hon. to change the background color
of
every textbox control on a form, you have to *set the value* of the
*backcolor property* of each control, using one SetValue action for each
control, in a macro.
to change the color only when the combo box has a certain Value, you need
to
set a condition on the macro. assuming that the name of the combo box
control is [Status], try the following example, as
first "row" of macro should be
MacroNameColumn: setcolor
ConditionColumn: [Status] = 11
Action: SetValue
Comment: sets the backcolor to gray
Arguments...
Item: [TextboxControlName].[BackColor]
Expression: 12632256
second and subsequent rows of macro should be
MacroNameColumn: <leave it blank>
ConditionColumn: ...
<the three dots with no spaces between them is called an ellipsis>
Action: SetValue
Arguments...
Item: [TextboxControlName].[BackColor]
Expression: 12632256
again, one set value action for *each control* that you want to change the
backcolor on. and remember, you'll want to also change the back color
*back
to white*, or whatever color is originally was, for records where the
status
is NOT 11. the easiest way to do that is to extend the macro so it serves
both purposes, as
first "row" of macro should be
MacroNameColumn: setcolor
ConditionColumn: [Status] = 11
Action: SetValue
Comment: sets the backcolor to gray
Arguments...
Item: [TextboxControlName].[BackColor]
Expression: 12632256
second and subsequent rows of macro should be
MacroNameColumn: <leave it blank>
ConditionColumn: ...
<the three dots with no spaces between them is called an ellipsis. you can
read up on it in Access Help, to better understand how it works>
Action: SetValue
Arguments...
Item: [TextboxControlName].[BackColor]
Expression: 12632256
next row, after the SetValue action has been set up for each textbox
control, should be
MacroNameColumn: <leave it blank>
ConditionColumn: ...
Action: StopMacro
then, the next row of macro should be
MacroNameColumn: <leave it blank>
ConditionColumn: <leave it blank>
Action: SetValue
Comment: sets the backcolor to white (or whatever color you choose)
Arguments...
Item: [TextboxControlName].[BackColor]
Expression: 16777215
subsequent rows of macro should be
MacroNameColumn: <leave it blank>
ConditionColumn: <leave it blank>
Action: SetValue
Arguments...
Item: [TextboxControlName].[BackColor]
Expression: 16777215
the result is that when the Status = 11, the first "half" of the macro
runs,
changing the textbox controls' backcolor properties to gray, then the stop
macro action stops the macro. when the Status does NOT equal 11, the first
half of the macro is skipped (including the stop macro action), and the
half
runs, changing the textbox controls' backcolor property to white.
run the macro on the combo box control's AfterUpdate event, and probably
on
the form's Current event, if you're using the form to display existing
records as well as enter new records.
hth
LMB said:
Didn't work. I just tried it with the Status Text box. This is what I
tried
Item: [Resigned].[BackColor]
Expression: 12632256
Item: [11].[BackColor]
Expression: 12632256
It's a combo box. I have it bound to the tblStatusList 11 is the ID and
Resigned is the description.
Linda
tina said:
use the SetValue action. you'll need a SetValue action for each textbox
control, with arguments set as
Item: [TextboxControlName].[BackColor]
Expression: 12632256
replace TextboxControlName with the correct name of a textbox control, of
course.
the number above is a medium gray. you can enter the number for any shade
of
any color you wish to see.
hth
Using Access 2003. I have a form that has employee records. I have a
control for status. I want to make all the text boxes on the form change
to
a grey background instead of white if the status box has resigned in it.
Is
that something I can do with the macro builder? I opened it up but
I'm
not
sure what the function would be.
Thanks,
Linda