Solved If a combo box field is empty Then expression (1 Viewer)

angekap

New member
Local time
Today, 22:37
Joined
Mar 16, 2021
Messages
12
Hi I have a form and at the end I have where if the message box answer is YES and the combo box (SELSUPPLIER) value is not filled Then I want it to follow the code. I'm stuck at the bottom line:

Response = MsgBox(Msg, Style, Title)

If Response = vbYes And "SELSUPPLER" Is Null Then

I think I am not using the IsNull command correctly ?

Can anyone help ??

Thanks
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:37
Joined
Aug 30, 2003
Messages
36,126
Try

If Response = vbYes And Len(Me.SELSUPPLER & vbNullString) = 0 Then

You could use IsNull() but the above also tests for a zero length string.
 

angekap

New member
Local time
Today, 22:37
Joined
Mar 16, 2021
Messages
12
Try

If Response = vbYes And Len(Me.SELSUPPLER & vbNullString) = 0 Then

You could use IsNull() but the above also tests for a zero length string.
 

angekap

New member
Local time
Today, 22:37
Joined
Mar 16, 2021
Messages
12
Hi Yes it works however my mistake I should have written if it is not 0 !! How would I write it ..Thanks Again !!!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:37
Joined
Aug 30, 2003
Messages
36,126
The value is not 0, or it isn't Null? One of these

If Response = vbYes And Me.SELSUPPLER <> 0 Then

If Response = vbYes And Len(Me.SELSUPPLER & vbNullString) > 0 Then
 

angekap

New member
Local time
Today, 22:37
Joined
Mar 16, 2021
Messages
12
The value is not 0, or it isn't Null? One of these

If Response = vbYes And Me.SELSUPPLER <> 0 Then

If Response = vbYes And Len(Me.SELSUPPLER & vbNullString) > 0 Then
Thank You So Much worked like a dream !!! Much Appreciated !!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:37
Joined
Aug 30, 2003
Messages
36,126
Happy to help!
 

Users who are viewing this thread

Top Bottom