How to inform a user by search result?

G

ghost

Greeting,
I have a form for showing the result of search. In this form there is a
subform for showing the result. What I want to do is once the user put the
criteria and click the button for opening the form of the result, a message
or label appears in the form result telling the user there is no data found
if there is no data. How can I do that?
 
T

Tom van Stiphout

On Sat, 26 Jan 2008 13:10:01 -0800, ghost

You could check the RecordCount of the RecordsetClone of the subform:
if Me.yoursubformcontrolname.Form.RecordsetClone.RecordCount = 0 then
Msgbox "There is no data matching these criteria",vbInformation
end if

-Tom.
 
Top