IsNull(ComboBox.Value) or just IsNull(ComboBox) (because Value is the
default property of an Access combo box) should work in most circumstances.
IsNull(ComboBox.Text) won't work, because the Text property returns a
String, and a String cannot be Null. IsEmpty(ComboBox.Text) or
IsEmpty(ComboBox.Value) won't work, as I understand it, because IsEmpty()
returns true only when the argument is an uninitialised Variant *variable*,
to the best of my knowledge, there is no way for a control property to
return the Empty value.
One situation in which IsNull(ComboBox) or IsNull(ComboBox.Value) may not
meet your needs is where the combo box contains a zero-length string. The
following expression will return True if the control contains either Null or
a zero-length string ...
Len(ControlName & vbNullString) = 0
.... and the following expression will also return True if the control
contains nothing but spaces ...
Len(Trim$(ControlName & vbNullString)) = 0
--
Brendan Reynolds
"ColinWard" <je*********@hotmail.com> wrote in message
news:40*********************@news.frii.net...
Hi again.
I am trying to figure out how to make sure that a value has been
selected from a combobox on a form. I have tried using
isnull(comboboxname.text) and
isempty(comboboxname.text)and isnull(comboboxname.value) in the onexit
event but I cannot get it to work.
basically the combo contains a value list of possible salutations(e.g.
Mr., mrs., etc.) and I want to be sure that the user chooses one of the
salutations before they can do anything else.
thank you
Colin
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!