General discussion

Locked

Access 97 Field Colors

By MRA2 ·
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

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access 97 Field Colors

by jamiep In reply to Access 97 Field Colors

you'd have to do something like :

If txtbox1 is null then
<change color code>
end if

do it for each text box.

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

Collapse -

Access 97 Field Colors

by MRA2 In reply to Access 97 Field Colors

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

Collapse -

Access 97 Field Colors

by Bob Sellman In reply to Access 97 Field Colors

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.

Collapse -

Access 97 Field Colors

by MRA2 In reply to Access 97 Field Colors

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

Thanks Again,
Alan

Collapse -

Access 97 Field Colors

by MRA2 In reply to Access 97 Field Colors

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums