Changing BackColor

  • Thread starter Thread starter Sash
  • Start date Start date
S

Sash

I have the following code (just a snippet, test other fields the same way) to
change the color of incomplete fields on a continuous form. My issue is that
the user can move to the next record without fixing the prior and if they
leave a different field blank that changes all the forms for that field to
red and you loose whatever what highlighted on the prior. Is there someway
to not allow them to enter a new record until complete? Oh and this code is
executed "After Insert"

Dim lgRed As Long
lgRed = RGB(255, 64, 64)

If IsNull(Item_Number) Then
MsgBox "Please Complete Item Number"
Me!Item_Number.BackColor = lgRed
End If
 
Don't forget that you can always just use one of the eight VBA color
constants such as vbBlack, vbRed, vbGreen, vbYellow, vbBlue, vbMagenta,
vbCyan, vbWhite

ctrlTxt.Backcolor = vbRed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top