Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I think NEED TO SLOW DOWN THE RUNNING OF A MACRO!

Status
Not open for further replies.

kimmole

Technical User
May 9, 2002
49
GB
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.

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!!!!!
 
Hi,

Just a comment:

Processes may SEEM to overtake one another, but a following process WILL NOT be activated before the preceding (and calling) process has completed.

Regards,

Darrylles "Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
You may want to add code to your BAT file to check to see if the .ldb file still exists. If it still exists, it is still open, so loop back and try again:

Loop:
IF EXISTS database.ldb GOTO Loop

Once the ldb file goes away, the .BAT file can continue.
 
thanks guys ....sorted now...
best regards kimbo:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top