Show msgbox when no records found

Lourry

Registered User.
Local time
Today, 09:54
Joined
May 19, 2004
Messages
41
Hello all,

I have a "main" form with a search button on it and when a user click on the search button, it will perform a search and open up a "search results" form and display all the records matching the criteria entered in the "main" form. THe "search results" form is a continuous form. When a user enters a criteria that doesn't match with any of the existing records, access will just open "search results" with a blank row on the form. How can I code it so that when there is no results to return, it will pop up a message box saying "NO MATCH FOUND" with an OK button for the user to click and it will take the user back to the "main" page?

I am using A97 and sql to query the database for matching criteria.

Thanks in advance!

-Lory :confused:
 
Hello,

I saw that thread but it doesn't work, I get an error saying I'm making an invalid reference to the recordsetclone property.

My search form have controls that are unbound, my search results form has controls that are unbound. It shows record becuase I have set Forms!Search_Results.recordsource equal to a SQL statment depending on the search criteria.

Any ideas?

Thanks again!
 
Lory

I have a sample db that may be what you are looking for. The issues is that it is around 200kg, which is above the attachement limit. If you want if just send me an e-mail to support@nlsa.org and I will get it to you.

Cheers!!!!!

Lou
 
Thanks Lou,

Sorry for the late reply, I have sent you an email!
 
Hi Lory

I received your e-mail and responded to it by sending the sample DB

Cheers!!!!!!


Lou
 
Thank you Lou!

I received the sample DB, although I was missing some object or libraries for it to compile properly, but I was able to look at the code. So, it all worked out and my DB is working perfectly now!

Thank you so much :D
 

Users who are viewing this thread

Back
Top Bottom