Combobox question

  • Thread starter Thread starter Clay Forbes
  • Start date Start date
C

Clay Forbes

Ok, i have tried a couple different things but i can not figure out
how to make it so when user clicks cmd button it checks to see if
combo3 is empty.
 
Wrong Group, but assuming that the button and the combo are on the same form you
can check the combobox value

If Len(Me.Combo3 & vbNullstring) = 0 Then
'NEVER MIND
Else
'Execute the existing code

End if
 
Its not. Does it need to be? if so can you give me the name of a group
that i should post it to?
 
what does the expression Len mean?

John Spencer (MVP) said:
Wrong Group, but assuming that the button and the combo are on the same form you
can check the combobox value

If Len(Me.Combo3 & vbNullstring) = 0 Then
'NEVER MIND
Else
'Execute the existing code

End if
 
It is a function that returns the LENgth of a string.

So if your combo is null or contains a string the is zero-characters long, the
function will return zero. Adding a zero-length string (vbNullString) to a null
gives you a zero-length string and add a zero-length string to a zero-length
string also gives you a zero-length string.
 
Back
Top