donkey9972
Registered User.
- Local time
 - Today, 04:49
 
- Joined
 - May 18, 2008
 
- Messages
 - 193
 
Hi,
I am trying to change the background color of the unbound field on the form I have which I have successfully done using the following code:
	
	
	
		
My issue is I have 5 fields I need to do this for, is there a better option to do this other than running this code in the "on exit" for each field?
 I am trying to change the background color of the unbound field on the form I have which I have successfully done using the following code:
		Code:
	
	
	Private Sub txtFirstName_Exit(Cancel As Integer)
If IsNull(txtFirstName) Then
    Me.txtFirstName.BackColor = vbRed
Else
    Me.txtFirstName.BackColor = vbWhite
End If
End Sub
	My issue is I have 5 fields I need to do this for, is there a better option to do this other than running this code in the "on exit" for each field?