Run macro on startup only if it has not been run previously today

N

NeoFax

I have a macro that I run when in the morning and then everyone can
access the information. I would like to make a Front End Form that
allows managers to open the form and have the data without waiting for
me to run the macro. I know that a macro named autoexec will run on
the database startup, but I would like to know if there is a way for a
front end to check if a table has a value of 1 for ran already and not
run the macro or 0 and then run the macro. I know that there may be a
slight chance that the macro kicks off and gets to half way and then
someone else opens their front end and it can cause a problem, but
that is a small chance I am willing to take.
 
J

Jeff Boyce

I came up with a solution to a similar requirement, but via a different
path.

Every time one of my applications starts up, it runs a procedure (not a
macro) that checks to see if there's an entry in a table for today's date.
If there is, it bypasses the rest of the routine.

If there is not already a record with today's date, the procedure does this
and that (and adds a 'today' date/timestamp) record, then passes control
back to the application.

It that something like what you're looking to do?

Regards

Jeff Boyce
Microsoft Access MVP


--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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