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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More than 3 conditional formats?

Status
Not open for further replies.

CJSwed

Technical User
Mar 29, 2005
55
US
Hi all,
I am working with a form in which I need more than 3 conditional formats. I attached the form in case anyone wants to take a peek. What I am trying to do is in the column "section points to" is to change the background color. For example if the word "oranges" is entered into the text box to change the background color to orange, if "grapes" is entered to change the background to green.

I tried doing this through the user interface but as you know it only accepts up to 3 conditional formats and I have more than three. I have worked with Access plenty, not an expert but certainly maintain databases but never ventured into VBA before. Any tips or hints as to how this can be accomplished? I've seen putting vba into the "onformat" event mentioned but I can not locate anything labeled "onformat"

Thanks for any help...

Chris
 
This is a report's forum and you mention On Format which is a report event however your question states "I am working with a form". Help us out here and provide some better information.

Duane
Hook'D on Access
MS Access MVP
 
Without respect to where you are trying to do what, the ACTUAL conditional formats are limited to THREE elements. However, using VBA, you can incorporate anynumber of conditions for the given format. By using the procedure, you can also have the return argument be a 'color' (e.g. RGB value) for the condition and apply this to the control.



MichaelRed


 
This can be done with a continuous report using the "onprint" event but not a continous form. Even with vba you are limited to 4 colors (3 conditions and the default). If the form is not continous you can use vba to make it appear that there are more than three color conditions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top