View Full Version : Change form edit box color from query


DebSabre
07-29-2003, 11:07 AM
I have a form with edit fields. The blank fields I would like to change the background color to red. This is to indicate to the user these fields may be entered. So I have two issues: 1) is the table field blank 2) if it is blank, change form background color to red. How does this look in either a SQL statement or criteria in a query design?

pdx_man
07-29-2003, 11:11 AM
What version of Access are you using? Check out Conditional Formating under Access Help. Otherwise, you are going to have to write code to check the contents of the text boxes using the form's On Current event procedure. Something like:

If IsNull(Me.MyField) Then
Me.MyField.Backcolor = vbRed
Else
Me.MyField.Backcolor = vbWhite
End If

DebSabre
07-29-2003, 11:16 AM
I am using Access 97. How will your suggestion work for a continous form?

pdx_man
07-29-2003, 11:22 AM
Well ... that's where we move into a difficult area ... it doesn't work.