By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,640 Members | 2,094 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,640 IT Pros & Developers. It's quick & easy.

No records found message

P: n/a
jpr
Hello,

I am using a form with a textbox and a cmdbutton to search for records
in a table. The result will be displayed using a form.

This is the code behind the txtbox:

DoCmd.OpenForm "myform", acNormal, "myquery", "", , acNormal

The form is opened using the myquery as filter.

I would like to add a message like "No record Found" if the search does
find a record with the criteria typed in the textbox. Basically I don't
want the default error message to appear and the blank form.
Is there a way I can do this? Thanks.

Jan 9 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Well, you can either use DLookup or a recordset to see how many records
get found, or you can use an OnError statement to go to a place in your
code where you pop up a personalized msgbox.

jpr wrote:
Hello,

I am using a form with a textbox and a cmdbutton to search for records
in a table. The result will be displayed using a form.

This is the code behind the txtbox:

DoCmd.OpenForm "myform", acNormal, "myquery", "", , acNormal

The form is opened using the myquery as filter.

I would like to add a message like "No record Found" if the search does
find a record with the criteria typed in the textbox. Basically I don't
want the default error message to appear and the blank form.
Is there a way I can do this? Thanks.
Jan 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.