Add Message Box IF 2 conditions are met..

123dstreet

Registered User.
Local time
Today, 07:55
Joined
Apr 14, 2010
Messages
122
Hi all! I've been searching high and low to find the right code for this: In a form, if combo316.visible=true AND combo.316= IsNull Then, i need a message box to pop saying 'Please select a choice for this combo box'. and then go directly back to that form and highlight that combo box.

any help would be greatly appreciated!

Thanks
D
 
It would be:

If Me.combo316.visible=true AND IsNull(Me.combo.316) Then...

But it could also have an empty string if someone started to put something in and then backspaced it. So this would be better:

If Me.combo316.visible=true AND Len(Me.combo.316 & "") = 0 Then...
 
What have you tried that fails? A test for Null and ZLS is:

If Len(Me.Whatever & vbNullString) = 0 Then
 
and should this be done on the before update event on the form?
 

Users who are viewing this thread

Back
Top Bottom