Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change backcolor of textbox in DataSheet view 1

Status
Not open for further replies.

kermitforney

Technical User
Mar 15, 2005
374
US
I would like to change the backcolor of a textbox to grey (RGB(128,128,128), After Update. The issues I am having are, one, VBA is not effective and does not change the back color
Code:
 randtxtboxname.BackColor = RGB(128, 128, 128)
and , second, the only other way I know of accomplishing this is with Conditional Formatting, but I am not sure if this is possible comparing with a past value. In other words, I am not sure how to get Conditional Formatting to function upon and Edit action.

Any help is greatly appreciated. Thanks.
 
If you want to set the formatting for only the current record in datasheet (or continuous), you will need to use conditional formatting. Any other code to set a property will show the same formatting for every record.

Conditional formatting relies on an expression that can be calculated from a single record. Are you storing anything in your record that identifies the textbox has been updated?

Duane
Hook'D on Access
MS Access MVP
 
Are you storing anything in your record that identifies the textbox has been updated?

In the backend, yes via trigger, but nothing that I am pulling for the front end.
 
Could we see an example of the condition(s) you're talking about? Perhaps you could use the AfterUpdate event to assign a value to a hidden, bound field, then use this field's value as a condition for Conditional Formatting, using the "Expression Is" construct.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top