Design/Strategy Question


G

Guest

How can I design a procedure that will run a macro on a conditional
basis...that is once, and only once, each day?

I need to re-build several tables once once each day, so I have a marco that
handles these steps. However, I don't want the marco to run every time the
database is openned, only the the first time each day.

Thanks,
Ted
 
Ad

Advertisements

I

Immanuel Sibero

Hi,

You could add a table with one date field and have your macro writes today's
date in it. The macro checks if today's date has been written to the table.
If today's date has not been written, execute the rebuild and write today's
date. If today's date has been written then exit.


HTH,
Immanuel Sibero
 
G

Guest

Yeah, I guess that's where I'm getting stuck. I am having a trouble writing a
macro that uses the date comparison condition to execute another macro. I
assume that I want to use the conditions within the macro for this purpose.

So, I need a condition expression that compares the Last_Update value
against the current date and based on the result it may execute a RunMacro
action to re-build the tables.

I have a table called [Update_Date] with 1 field called [Last_Update]. I
tried [Update_Date]![Last_Update] = Date() as the condition and RunMacro as
the action, but I always get an error that it can't find [Update_Date].

So am I close or completely off-base?

Ted
 
T

TPratt

You can utilize the Window's scheduler (Scheduled Tasks) to open a specific
database and run a specific macro. It works much better than an autoexec.
Use this command line in the "Run:" box of the Properties window.

"C:\Program Files\Microsoft Office\Office\msaccess.exe"
"AddressToAccessDatabase.mdb" /x MacroName




TD11 said:
Yeah, I guess that's where I'm getting stuck. I am having a trouble writing a
macro that uses the date comparison condition to execute another macro. I
assume that I want to use the conditions within the macro for this purpose.

So, I need a condition expression that compares the Last_Update value
against the current date and based on the result it may execute a RunMacro
action to re-build the tables.

I have a table called [Update_Date] with 1 field called [Last_Update]. I
tried [Update_Date]![Last_Update] = Date() as the condition and RunMacro as
the action, but I always get an error that it can't find [Update_Date].

So am I close or completely off-base?

Ted

Immanuel Sibero said:
Hi,

You could add a table with one date field and have your macro writes today's
date in it. The macro checks if today's date has been written to the table.
If today's date has not been written, execute the rebuild and write today's
date. If today's date has been written then exit.


HTH,
Immanuel Sibero




marco
that
 
Ad

Advertisements

G

Guest

Thanks, that is exactly what I needed.

TPratt said:
You can utilize the Window's scheduler (Scheduled Tasks) to open a specific
database and run a specific macro. It works much better than an autoexec.
Use this command line in the "Run:" box of the Properties window.

"C:\Program Files\Microsoft Office\Office\msaccess.exe"
"AddressToAccessDatabase.mdb" /x MacroName




TD11 said:
Yeah, I guess that's where I'm getting stuck. I am having a trouble writing a
macro that uses the date comparison condition to execute another macro. I
assume that I want to use the conditions within the macro for this purpose.

So, I need a condition expression that compares the Last_Update value
against the current date and based on the result it may execute a RunMacro
action to re-build the tables.

I have a table called [Update_Date] with 1 field called [Last_Update]. I
tried [Update_Date]![Last_Update] = Date() as the condition and RunMacro as
the action, but I always get an error that it can't find [Update_Date].

So am I close or completely off-base?

Ted

Immanuel Sibero said:
Hi,

You could add a table with one date field and have your macro writes today's
date in it. The macro checks if today's date has been written to the table.
If today's date has not been written, execute the rebuild and write today's
date. If today's date has been written then exit.


HTH,
Immanuel Sibero




How can I design a procedure that will run a macro on a conditional
basis...that is once, and only once, each day?

I need to re-build several tables once once each day, so I have a marco
that
handles these steps. However, I don't want the marco to run every time the
database is openned, only the the first time each day.

Thanks,
Ted
 

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

Similar Threads


Top