Hi Macky.
OK, here is what you do.
For the example, I will assume that your database is in :
\\myserver\mackydb$\mydb\mydb.mdb
If you have a home directory (that is backed up nightly), this is the best place for the batch file. Lets say this directory (using for the example) :
\\myserver\Data\Users\macky\myschedtasks
Find the path for msaccess.exe. It should be something like :
C:\Program Files\Microsoft Office\Office\msaccess.exe
OK, so open the database. Go to the Tables tab on the database window. Select "New". Create a table with the structure :
myname text
timestamp date (format:dd mm yyyy hh:nn:ss)
in the "timestamp" field, select the default value of '=Now()' (without the quotes)
call this table "tmptesttbl". You may accept that access creates a primary key, if you so wish. This is not so important.
Go to Macro's tab on the database window. Select "New". add the command : RunSQL and give it the following sql statement :
insert into tmptesttbl (myname) values ("macky"
now save the macro as tmptestmacro.
OK, so exit access.
now open either a text editor (that saves to dos format), or open a dos session, cd to the "\\myserver\Data\Users\macky\myschedtasks" folder, and type "edit tmpmacky.bat"
now for the task you should enter the line of text as :
"C:\Program Files\Microsoft Office\Office\msaccess.exe" "\\myserver\mackydb$\mydb\mydb.mdb" /X tmptestmacro
please include the quotes as they tell windows that the statement does not use the old 8.3 format.
Save your batch file (if your using a text editor make sure that the file will be saved in DOS mode).
Now set up a scheduled task (I'm not sure how to do this in NT as I use Win XP), its probably in control panel, somewhere.
Make sure that the task runs in a few minutes time.
wait for it to happen.
did it work? If you open the database and look at the table we created earlier, there should be an entry with (approximately) the same time that you scheduled the task to run.
Now all you have to do is change the dos file so that it executes the macro that you wanted to run, and then change the scheduled task to do it when you want it to occur.
Please let me know if this helps.
Regards,
Mr Big. Dont be small. be BIG