Count search results

ltelfer

New member
Local time
Today, 18:12
Joined
Sep 16, 2002
Messages
7
I'm using a macro to open a form. The macro has a where condition which obviously changes the number of results displayed depending upon the basis of the condition.

I have two questions:
* Is it possible to count the number of results?
* Can I use that reult to trigger another action?

E.G. If the number of reaults is 0 I do not want a message to tell the user that ans then return to the previous (calling) form.

Any help would, as always, be appreciated.

Thanks
Lawrence

:confused:
 
Sorry...the example should read:

E.G. If the number of results is 0 I want a message to tell the user and then return to the previous (calling) form.



:D
 
Private Sub Form_Open(Cancel As Integer)
With CodeContextObject
If (.RecordsetClone.RecordCount = 0) Then
DoCmd.Close
Beep
MsgBox "There are no records for this period.Please check the dates you have entered.", vbOKOnly, "No Records"

End If
End With

End Sub
 

Users who are viewing this thread

Back
Top Bottom