Return the value of Count(*) as a condition in a macro

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

Guest

I have a macro that opens a form bound to a query. If the query is empty, I
have a msgbox that says "No records to view", which would open if the query
is empty. How do I write the condition in my macro to make that happen. And
it has to be a macro.

Thanks
Paul
 
first line of macro:

Condition: DCount(1, "MyQueryName") < 1
Action: Msgbox

second line of macro:

Condition: ...
(the three dots are an ellipsis, which tells Access to execute the line if
the last stated condition in the macro was met.)
Action: StopMacro

third line of macro:

Condition: <leave blank>
Action: OpenForm

hth
 
Back
Top