no data in combo box

C

chriske911

I use a combo box after update event to call another form holding the
record with that same data
but how can I immediately show a "NO DATA" form if the combo box
recordsource holds no values?
for a report you could use the no data event but how can I trigger this
for a combo box?

thnx
 
T

TonyT

You don't, you set limit to list to 'yes' in the data properties of the
combobox, the you can use the Not In List event to pickup new entries. And
then you can use the after_update event to check that there is a valid
selection being made from the combobox before you even atempt to oopen the
form eg;

If Not Isnull(me.cboMyCombBox) Then
docmd.Openform etc etc
Else: msgbox "You must select from the list to continue"
End If

TonyT..
 
M

Marshall Barton

chriske911 said:
I use a combo box after update event to call another form holding the
record with that same data
but how can I immediately show a "NO DATA" form if the combo box
recordsource holds no values?
for a report you could use the no data event but how can I trigger this
for a combo box?


You can check the combo box's ListCount property to see if
the list is empty.
 
K

kingston via AccessMonster.com

In your combobox afterupdate event, check the recordsource.recordcount
property. If it is = 0, then display your message or whatever. HTH.
 
C

chriske911

chriske911 expressed precisely :
I use a combo box after update event to call another form holding the record
with that same data
but how can I immediately show a "NO DATA" form if the combo box recordsource
holds no values?
for a report you could use the no data event but how can I trigger this for a
combo box?

addendum:
I want to show a "NO DATA" if the combo box list is empty instead of
showing the form holding that combo box
I don't want to show that "NO DATA" form instead of the form I would
call using the after update event of the combo box
if you know what I mean

grtz
 
Top