Combo Box NULL value

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hello all,
I have reposted this due some confusion on a previous post.

I have a form setup so that if a particular value in
combobox 1 is selected, it will show combobox2. I would
like to write code on combobox2 LOSTFOCUS event that will
force a value to be selected from the list. The values
selected write to a table, but not every record is going
to show combobox2, so I can't set the table field
property to required.
What is the default value of a combo
box if nothing is selected from the dropdown?

This is an example of my code that doesn't work. I have
also tried "" and BLANK. I could set the default value to
0 (zero), but seems like that would not be the proper way
to go.

If Combo4 Is Null Then
MsgBox "a"
Else
MsgBox "b"
End If



Thank you for reviewing this question.
 
Hi David,

Use the IsNull() function

If IsNull(Combo4) Then
MsgBox "a"
Else
MsgBox "b"
End If

HTH
Steve C
 
Thank you Steve this did the trick.
-----Original Message-----
Hi David,

Use the IsNull() function

If IsNull(Combo4) Then
MsgBox "a"
Else
MsgBox "b"
End If

HTH
Steve C




.
 
Back
Top