checking if combobox any item choose

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

Hello.

How can I check if a combobox has any option choosed.

What I'm looking for iis something like:

if combo1.text = "" then
msgbox "Error"
end if


How can I do this?


Thanks,
Marco
 
Marco said:
Hello.

How can I check if a combobox has any option choosed.

What I'm looking for iis something like:

if combo1.text = "" then
msgbox "Error"
end if


How can I do this?


Thanks,
Marco


Generally, if no item in the combo box is chosen, the control's value will
be Null, You can't check whether the control = Null, because Null isn't
"equal" to anything, so you have to use the IsNull function:

If IsNull(Me!Combo) Then
MsgBox "Error"
End If
 
THANKS MAN.

Cheers,
Marco





Dirk Goldgar said:
Generally, if no item in the combo box is chosen, the control's value will
be Null, You can't check whether the control = Null, because Null isn't
"equal" to anything, so you have to use the IsNull function:

If IsNull(Me!Combo) Then
MsgBox "Error"
End If


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top