Search window - message stating no records matched criteria

L

Lori

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!
 
L

Lori

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!
 
Top