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
--
Bill Mosca, MS Access MVP
http://tech.groups.yahoo.com/group/M..._Professionals
"Tom" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>