A
alex
Change background color of record
Using Access ’03…
I have a form set to continuous forms view. It’s based on a qry,
based on a tbl.
There are four controls, all bound to the query.
I understand that in continuous forms view, there’s really only one
control per field…I’m inquiring, however, if I can change the
background color of an individual record based on the value of a
control. Maybe continuous forms is not the way to go!
E.g.,
In the after update event of txtField1
Dim lngWhite as long
Dim lngRed as long
lngRed = RGB(255,0,0)
lngWhite = RGB(255,255,255)
If me.txtField1.value = “X” then
Me.txtField2.backcolor = lngRed
Else
Me.txtField2.backcolor = lngWhite
End if
In the code above, if txtField1.value is X, the backcolor of txtField2
will change to red for every record. I need only the individual
record (txtField2 in this example) to be red, not every occurrence
of.
Thanks for any advice.
alex
Using Access ’03…
I have a form set to continuous forms view. It’s based on a qry,
based on a tbl.
There are four controls, all bound to the query.
I understand that in continuous forms view, there’s really only one
control per field…I’m inquiring, however, if I can change the
background color of an individual record based on the value of a
control. Maybe continuous forms is not the way to go!
E.g.,
In the after update event of txtField1
Dim lngWhite as long
Dim lngRed as long
lngRed = RGB(255,0,0)
lngWhite = RGB(255,255,255)
If me.txtField1.value = “X” then
Me.txtField2.backcolor = lngRed
Else
Me.txtField2.backcolor = lngWhite
End if
In the code above, if txtField1.value is X, the backcolor of txtField2
will change to red for every record. I need only the individual
record (txtField2 in this example) to be red, not every occurrence
of.
Thanks for any advice.
alex