Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box null values

Status
Not open for further replies.

chris6976

Technical User
Mar 4, 2003
28
GB
Hi

This is a very simple question!
I wish to display a message box if a combo box value is not selected.

Is the VBA code >

If cboEx.Value = "" Then
MsgBox "Message"
cboEx.SetFocus
Else

End If

The "" does not appear to work (I know it works in VB6)

A very simple answer im sure!!

Thanks
 
Change:

If cboEx.Value = "" Then

to:

If Me![cboEx].Value = "" Or IsNull(Me![cboEx].Value) Then

This checks for either an empty string or a null value....also uses the Me![] to distinctly define the control. ****************************
Only two things are infinite, the
universe and human stupidity, and
I'm not sure about the former.
(Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: wildmage@tampabay.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top