Count in combo box

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi,
I have a form with combo box (combo1)which based on query.
When the form load I would like to count the item in combo1.
If there are no items, the form loading will be canceled and massage "No
items to choose".

Any ideas,

Thanks,
T
 
The simplest way would be to use a DCount() function to check before you
even open the form.

If DCount("CustID", "Orders", "CustID=123")=0 Then
MsgBox "No Data available for selected filter."
Else: DoCmd.OpenForm "myForm"
End If
 
Thanks.
Bill Mosca said:
The simplest way would be to use a DCount() function to check before you
even open the form.

If DCount("CustID", "Orders", "CustID=123")=0 Then
MsgBox "No Data available for selected filter."
Else: DoCmd.OpenForm "myForm"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top