Message Box!

G

Guest

I have currently designed a form, which runs multiple
queries (about 10). Each query returns data that needs to
be corrected seperately. However some queries, have no
search results. In these cases, I am trying to create a
message box, that will pop up saying "No Data matches
Criteria!". However, I am having difficulty figuring out
how to do that. I would like to make it, so that if the
number of records returned in a query is zero, then the
message box pops up. Is there a way to do this?> I've
created the message box, but I do not know how to
implement it into the query.
 
S

Steve Schapel

Anonymous,

Since this is a macros newsgroup, I assume your queries are being run
via a macro, using an OpenQuery macro action? And I assume thesew are
action queries (e.g. Append, Update, Delete, etc). For each of the
action queries, you should make another Select query that returns the
same records. Then, in the Condition of the macro, you can put
something like this...
DCount("*","NameOfYourQuery")=0
.... as the Condition for your MsgBox action, and...
DCount("*","NameOfYourQuery")>0
.... as the Condition for your OpenQuery action.
 

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