Is there a way to change the background color of an object on a continuous form? I would like to have the back color of the form change per the data that is in a bound field.
Thanks
Is there a way to change the background color of an object on a continuous form? I would like to have the back color of the form change per the data that is in a bound field.
Thanks
You want to change the backcolor of form Detail section?
Use code. I expect VBA can do it, like:
Me.Detail0.Backcolor = vbred
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
This works, but it sets the back color for all the forms in continuous form. I am looking to achieve similar to conditional formatting in excel, for record background color.
Only thing I could think of currently would be to load a BITMAP and have it be set to the back of the form. then have different bitmaps for each color.
There isn't any 'record background' except for the AlternateBackColor property of Detail section and this cannot be effectively programmed conditionally in Continuous or Datasheet view. Have to use Conditional formatting for each control.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Alright, I will check that out
It sounds like you want conditional formatting for record rows. If so, the alternate row colour will not be what you want. How about a textbox control that spans the width of your form (or just the controls you want to highlight) that is positioned behind the data controls, whose properties you set in code depending on the condition? I have done something like this to show the logged in user control as yellow, just not for an entire row. You could play with the properties of the control as well (raised, sunken, bordered) to present some unique effects.
Micron's suggestion is the standard workaround for this kind of thing. You'll have to add a Field to your underlying Table to use as the Control Source for the Textbox, of course, otherwise, once again, the Control on all Records would be formatted as the Current Record dictates.
Once the Textbox has been created, you'll need set it Locked Property to Yes and Enabled Property to No; this is necessary to keep the cursor from tabbing into the Textbox.
In a Single View Form you could use code to set the Formatting, but in a Continuous View Form you'll then need to use Conditional Formatting, off the Ribbon, to set the Conditions/Back Colors as you want, probably using the Expression Is under the Condition dropdown.
Linq ;0)>
Actually, the control does not have to be bound to a field. Just tested.
The Conditional Formatting for all records is NOT dictated by the current record - that's the whole point of Conditional Formatting.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
You're right, of course...need to adjust my medication!
Linq ;0)>