Message Box!

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
Back
Top