Conditional Operation of Toggle Button Macro

H

Harry C

I'm using a toggle button on a form to execute a macro (created by Macro
Builder) consisting of a string of OpenQuery operations of MakeTable, Delete,
Update, and Append queries. I need to start the macro by comparing the
minimum value of a date field in table "A" to the maximum value of the date
field in table "B", and stop execution of the macro if the "A" value is less
than or equal to the "B" value. I would also like to display an appropriate
message explaining why execution was interrupted. Can I do this with Actions
in the Macro Builder?
 
S

Steve Schapel

Harry,

Yes. Set the Condition in the macro to the equivalent of:
DMax("[DateB]","table B")>DMin("[DateA]","table A")
 
H

Harry C

Thanks. I used that as a condition to execute another macro that beeped,
opened a Form with the error message, and stopped all macros. Probably a
crude way to do it, but it does what I want.

Steve Schapel said:
Harry,

Yes. Set the Condition in the macro to the equivalent of:
DMax("[DateB]","table B")>DMin("[DateA]","table A")

--
Steve Schapel, Microsoft Access MVP

Harry said:
I'm using a toggle button on a form to execute a macro (created by Macro
Builder) consisting of a string of OpenQuery operations of MakeTable, Delete,
Update, and Append queries. I need to start the macro by comparing the
minimum value of a date field in table "A" to the maximum value of the date
field in table "B", and stop execution of the macro if the "A" value is less
than or equal to the "B" value. I would also like to display an appropriate
message explaining why execution was interrupted. Can I do this with Actions
in the Macro Builder?
 

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