R
Rebecca
Hi,
I'm using Access 2000 and I've got a 2 column unbound
combo box that looks up values in a table (first column is
hidden bound column and contains an integer ID number,
second column is displayed and contains the corresponding
text value). I want to ensure that the user chooses a
value before exiting the form.
I tried to evaluate it using the IsNull function:
If IsNull(me.MyComboBox) then
msgbox "Please enter a value"
else
call RoutineThatProcessesData&ClosesForm
End If
I was getting an "invalid use of null" error when the
combo box contained data, but it evaluated correctly when
it was empty. I'm wondering if the data returned by the
combo box is a variant type or if it gets typed according
to the data it looks up. The only info I've been able to
find says that the column property of a combo box returns
a fixed type. I'm not referencing that property, but I
wonder if that still applies.
To add further confusion, I changed my routine so it
employed If not IsNull(me.MyComboBox)then... and it began
to evaluate properly. I have not been able to re-create
the problem, but I'm afraid that it's somehow randomly
occurring and will crop up again.
Any thoughts....
Thanks!
Rebecca
I'm using Access 2000 and I've got a 2 column unbound
combo box that looks up values in a table (first column is
hidden bound column and contains an integer ID number,
second column is displayed and contains the corresponding
text value). I want to ensure that the user chooses a
value before exiting the form.
I tried to evaluate it using the IsNull function:
If IsNull(me.MyComboBox) then
msgbox "Please enter a value"
else
call RoutineThatProcessesData&ClosesForm
End If
I was getting an "invalid use of null" error when the
combo box contained data, but it evaluated correctly when
it was empty. I'm wondering if the data returned by the
combo box is a variant type or if it gets typed according
to the data it looks up. The only info I've been able to
find says that the column property of a combo box returns
a fixed type. I'm not referencing that property, but I
wonder if that still applies.
To add further confusion, I changed my routine so it
employed If not IsNull(me.MyComboBox)then... and it began
to evaluate properly. I have not been able to re-create
the problem, but I'm afraid that it's somehow randomly
occurring and will crop up again.
Any thoughts....
Thanks!
Rebecca