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

Access/VB Color Behind Fields

Status
Not open for further replies.

Nina2001

Programmer
Dec 28, 2001
58
0
0
US
I'm trying to make 4 fields on my Access form change background color with the value entered. Example: if field is "1" then the color is green, 2 - color is yellow, etc. I got this to work on the single form view with some VB code. However, on the continuous form view (the most important one) It gives the color from the first row to all the following rows. I think the code found the first criteria and won't look for any more fields. Is there a way to make this work? I've been racking my brain for a month now on this! Any help would be GREATLY appreciated.

Nina
 
Sorry, as far as I know, there is no way to format individual records in a continuous form. If anyone knows differently, please post the method! :cool:

--Ryan
 
I tryed to use different colors for fields in Access continuous forms, and I found that is not possible.

I still need it and I know that I can use flex grid control or data grid control and these activeX have such a properties.
For the moment I cannot use because I get some errors from Access ("... the OLE server isn't registered..." or "... need license to use the control ...").

I know that is the only solution.
If you found how to use these activeX controls is perfect, because I have some coding for them but as I told you I cannot use.

Regards,
Mihai
 
Mihai,

Yes, I did figure this out it was a lot simplier than using activex. I can send you an email with the example db that was sent to me. I was actually able to put four boxes on top of each other with different colors and IF statements. It has been a real life saver!

Nina
 
Yes this can be done if it is a combo box, memo field, text box. In Access 2000 you can use "Conditional formatting" In Design mode, click on the combo box (control) then go to the formatting menu then conditional formatting. Then just follow from there.
 
I've had a similar problem with continuos forms and the only way I could get round this was to create four text fields with a different colour format for each one. You then use an IIF statement in the control source to select the data you need it too.

If you overlap the fields (i.e. so it looks like only one field), make the backcolor of each transparent then when you go to form view you should see the data in the relevant color.

Hardly perfect but it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top