Question Load Order?

jonathanchye

Registered User.
Local time
Today, 01:44
Joined
Mar 8, 2011
Messages
448
Hi all,

I am working in MS Access 2010. I have a login form for that is set to load from the "Display Form" property of the Current Database tab. Basically the login form loads first thing when the database is opened.

I have created a function that checks the server for latest FE version and updates it if needed. The code is located in the form's "On Open" event.

I have some problems with some users with the FE client getting corrupted while updated. It think it might have something to do with my code running a bit slow and the form tries to load while the code is attempting to delete and copy over new files.

Is there a better way of relocating my update code? Should I put it in the "On Load" event? I am thining of creating a macro with my update code. Will this be better?

Database opens -> runs Macro -> if update needed delete and copy over new db -> if no update then continue to load login form

Will this be better?
 
The way I handle deploying FE updates is a bit different...

I have some NT Batch code which ALWAYS copies down a fresh copy of the FE DB from the file server when the application starts. The desktop icon points to the NT Batch script on the file server, thus if that ever needed to be updated I would simply update the .CMD file on the server.

Then once the FE starts loading, it does a version check between a FE variables table which has a version string in it, and also a BE variables table which also has a version string in it. If they do not match, the application brings up an error message and application startup is halted as the client / server versions do not match.

Using this design, I never need to worry that someone damages their FE DB. "Application getting an error? Shutdown / restart / get a fresh copy of the FE DB."
 
I have some problems with some users with the FE client getting corrupted while updated. It think it might have something to do with my code running a bit slow and the form tries to load while the code is attempting to delete and copy over new files.
Those events don't run concurrently. One finishes before the other one kicks off. This is how Access/VBA works. You can use an AutoExec macro to first run your function then load your form.

Is there a better way of relocating my update code? Should I put it in the "On Load" event? I am thining of creating a macro with my update code. Will this be better?
You might want to take a look at this from MVP Tony Toews:
http://autofeupdater.com/
 

Users who are viewing this thread

Back
Top Bottom