Search window - message stating no records matched criteria

G

Guest

I have a search window which uses a form and a subform where the user enters
criteria and clicks on a Search button to display results in the subform.
How can I display a message to the user if no records matched the criteria
entered? What event would this be placed at? I have put code in my reports
at the On No Data event but am not sure where to put something to tell the
user no records matched their criteria.

Thanks!
 
G

Guest

Thanks! It worked great!

Ofer Cohen said:
For no data you can use this code

If Me.[SubFormName].Form.RecordsetClone.RecordCount = 0 Then
MsgBox "No Records found"
End If

For search, chech this link for a sample

http://www.databasedev.co.uk/text_search.html

--
Good Luck
BS"D


Lori said:
I have a search window which uses a form and a subform where the user enters
criteria and clicks on a Search button to display results in the subform.
How can I display a message to the user if no records matched the criteria
entered? What event would this be placed at? I have put code in my reports
at the On No Data event but am not sure where to put something to tell the
user no records matched their criteria.

Thanks!
 

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

Top