ForeColor if Null

  • Thread starter jversiz via AccessMonster.com
  • Start date
J

jversiz via AccessMonster.com

Hello Smart People!

This one is driving me nuts. After doing quite a bit of research, I cannot
find the answer that I need, so I am posting...

For a new record on frm1 I am trying to make the label (lblTest) for a text
box named txtTest a certain color if a value has not been filled in. For
some reason, I cannot get the code to work and I am guessing it is due to my
lack of understanding of our good old friend NULL. Here is what in both the
after update event for txtTest and the on current event for the form...

If Me.txtTest = Null Then
Me.lblTest.ForeColor = 255
Me.lblTest.FontBold = True
Else
Me.lblTest.ForeColor = 0
Me.lblTest.FontBold = False
End If

Why isn't the field red when I create a new record? Why is it that if I fill
something into the field, then delete it, that it doesn't get bolded in red?

Regards,
James C.
 
L

Linq Adams via AccessMonster.com

The thing to remember is that NULL is not a value, it's a condition. A
condition, in fact, that signifies ***the lack of a value*** and so nothing
can be equal to NULL!!
 

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

Top