I Need To Slow Down The Running Of A Macro!

KIMBOZZZ

Registered User.
Local time
Today, 13:14
Joined
Jun 17, 2002
Messages
14
i am using a button to start a macro which closes an active form which uses linked table information from my database back end... opens a dialog whith another button which runs a dos batch file to change the name of an archived back end to the name of the back end i whish to run....
this all works fine if i step the macro ...but when i come to run it for real the original back end ldb file is not cleared in time for the batch file to run.... it thinks the file is still in use!
so i need a way to slow down the point at which the starting of the batch file operates.

i've tried to put other forms in the sequence to allow time for the linkage from the front end to the data to clear but it don't seem to work....
help!!!!!:confused:
 
Look in Help Files under "DoEvents"

This may be what you need.

Michael
 
Are you calling DOS just to rename a file? If so, I suggest that you check the help files for the Name Statement for more options and details on how easy it is to rename a file or directory.

Name "C:\Test.mdb" As "C:\NewTest.mdb"

HTH
 
aggggggh!!!

i think you're both missing the point.... i need to hitch my front end to a different dataset on the fly .
in other words i need to use another datasource ie set of tables called the same as my master set with the samer relationships etc.

once a year all the tables are copied into pre existing empty databases... then when the user wants to work with this archived data he/she clicks to run a macro which closes any forms using any of the data from the linked tables,
renames the current backend to xxx.mdb and renames the relevent archive source so that it becomes the source of the front end's forms' data.

i do a similar thing already to swap out a data source for a test environment withought any problems.

closing the form which uses the current dastasource doesn't seem to let go of the bakend quick enough to stop the bat file from thowing up a sharing violation.


maybe i'm being dumb, but i cant find anything under "name statement" in my help files which remotly resembles my needs.

thanks anyhow .... and any further help would be greatly appreciated.
 
DoEvents

As Michael suggested above, have you tried implementing "DoEvents"? He did not miss your point.

And ghudson did not miss your point either but was offering a suggestion to make your life easier - which was to ditch the DOS batch file and just use the "Name" statement to carry-out your back-end file swap.

John
 
thanks all.... sorted it now using my batch files ....but i'll look into the name statement thang as wel for the future.

thanks ... once again for all your help...
i feel a bit out of my depth around you clever guys... but maybe one day i'll be able to write code....
bestest ...kimbo:)
 

Users who are viewing this thread

Back
Top Bottom