stop macro when query is empty

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form (showing one record at a time) that asks the user for input.
After the user puts in the information, they click on a button that starts a
macro. That macro sets a true/false box which removes the current record
from the select query criteria. The macro then reopens this same form asking
for user input on the next record.

When the query no longer has a records to display in the form, the macro
crashes and I have to manually clear the errors. Can someone please help me
with code or macro condition settings that will stop my macro of there are no
more records in the query.

Thanks in advance!
 
BLTibbs,

The equivalent of this in the Condition of the macro...
DCount("*","NameOfYourQuery")>0
 
That didn't work. Do I have to use a 'stop macro' command next to that
condition.. or why didn't that work? Now, I am getting the end macro error
before all of my records are out of the query.
 
Steve,

Thanks for your re-reply, but I figured it out. I had two instructions for
my macro and once I put your condition expression in front of both
instructions, my problem was solved.

Thanks again.
 
Back
Top