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

P

paulpenta

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
 
T

tina

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
 

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