Discussion Locked

Access 97 Field Colors

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

This should be an easy one....

On an Access 97 Form I have 3 fields. (AssocQ AssocF & AssocR).

If any of these fields have NO ENTRY, I want the color of the field box to be RED. If an entry is made, NO color change should occur.

I used the On Change event and wrote some code for each field, BUT my code changes the color of the box for EVERY RECORD in the table. I want only THOSE records where the field is empty to be colored.

Thanks in advance for your help.....

A2
MRA@mindspring.com

5 replies

by jamiep

you'd have to do something like :

If txtbox1 is null then

end if

do it for each text box.

(I think you would have to put it in the on activate event.

by mra2

Sorry but that does NOT WORK! The text box on each record turns the color.....

by bob sellman

I've encountered this and I'm not sure if this solution will work, but give it a try. It's a pain in the neck, but it might be a way to do what you want.

I'll describe what I'd try for one field. If it works, do the same thing for the other fields.

1. Hide the AssocQ control.
2. Make a second control that is not bound. (I'll call it AssocQDisplay.)
3. Set the value of AssocQDisplay to be equal to AssocQ. (Use build to build the reference to AssocQ on the same form.)
4. In code set the color of AssocQDisplay to RED if it is null.

Playing around with these ideas might give you a solution, although I don't remember if I ever came up with a real satisfactory solution.

by mra2

Sounds like you may have put me on the RIGHT TRACK. I will try your routine....

Thanks Again,
Alan

This discussion is closed to new replies.