Automatic running of a macro/code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm in the beginning stages of designing an inventory db. One thing I'd like
the db to do is to automatically "withdraw" quantities once a week. We have
a spreadsheet of students that change every week and shows how many students
actually graduated each week. There are items that will be issued to each
weeks class so we know from the spreadsheet how much to deduct from
inventory. So, here's my question.

Each Friday, before the spreadsheet is rerun w/ the new class coming in, I
want my db to tally the number of graduates so I do my inventory withdraw.
Wtihout someone manually going in and running a macro each week, is there a
way to run code or a macro automatically based on a preset timer? Perhaps
code that states "if today is Friday", etc. I'm thinking not, since the
program wouldn't even necessarily be open by anyone at the precise given
time. But, I thought I'd ask anyway. Thx, Dj
 
The part that bothers me is the use of the word spreadsheet. There are no
spreadsheets in Access, so either you are misusing the name or you are using
external Excel spreadsheets as part of your process.

The best way to do this would be to create a separate mdb file that contains
only the process you want to schedule. Use either an Autoexec macro or
identify a form in the Startup options to execute the code.

Use Windows Event Scheduler to set up the day and time to open and run this
mdb.

Notes:
You will have to link the tables used for this process to whatever mdb has
the data.
The computer than runs this process will have to be turned on during the
time the process executes.
 
Yes, I will be importing an excel spreadsheet just to tally the numbers that
I need to show as dispersements each week.

So then, if I have windows event scheduler to make this separate mdb tally a
count each week and my inventory mdb links the tally mdb, it seems to me I'll
still have to manually run a macro/code to get that week's dispersment
entered into my inventory mdb.
 
Not necessarily. If you can be sure of the path and name of the
spreadsheets, you can hard code them into your process with the
TransferSpreadsheet method. Whether you use import or link is up to you.

I would also suggest a Log table were you can record successful completeion
or errors in the process. Since you will not be there when it runs, you will
certainly want to know whether the run was correct.
 
I'll give it a try. Thanks!

Klatuu said:
Not necessarily. If you can be sure of the path and name of the
spreadsheets, you can hard code them into your process with the
TransferSpreadsheet method. Whether you use import or link is up to you.

I would also suggest a Log table were you can record successful completeion
or errors in the process. Since you will not be there when it runs, you will
certainly want to know whether the run was correct.
 
Back
Top