Conditional Operation of Toggle Button Macro

  • Thread starter Thread starter Harry C
  • Start date Start date
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?
 
Harry,

Yes. Set the Condition in the macro to the equivalent of:
DMax("[DateB]","table B")>DMin("[DateA]","table A")
 
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?
 
Back
Top