View Full Version : macro condition


Shawny
08-24-2001, 02:53 PM
You people who answer our questions are soooo wonderful. Thanks.
TableA has a date field. When I open the dB, I want to run a certain macro action (open form)if any record in TableA has a date that is <Date()-60. It's easy to run a query with that criteria but I don't want to show the records, I just want to do something if there are any. I'm stuck with macros cause I don't know VBA.

jwindon
08-26-2001, 06:09 PM
Do this first:

Create a form (frmOutdatedRecords) using the query for its base (it doesn't have to be fancy, use the Wizard and create a datasheet form)

Secondly, Create this macro:

1) Condition:
Action: OpenForm
Arguements: frmOutdatedRecords


2) Condition:
Action: Echo
Arguements: Echo on yes, status bar "Checking for outdated records...."

3) Condition: [Forms]![frmOutdatedRecords]![DateControlYouQueried] is not null
Action: Msgbox
Arguements: "There are outdated records!"

4) Condition: [Forms]![frmOutdatedRecords]![DateControlYouQueried] is not null
Action: StopAllMacros

5) Condition:
Action: Close
Arguements: Form, frmOutdatedRecords, prompt=no


Save this macro exactly as:

AutoExec

The macro will run when you start your database.

Email me if you have trouble. jwindon@kde.state.ky.us


[This message has been edited by jwindon (edited 08-26-2001).]