How to find if database is opened?

P_Henry

Registered User.
Local time
Today, 06:09
Joined
Dec 3, 2003
Messages
63
Hi,

May be a silly question...I need to be able to run some initial processes (table load etc) when the user first opens the database. Subsequent users need not do this processing.
How do I accomplish this within the form open module in Access :confused: ?

Thanks,
Priya
 
One way would be to set up a "Splash Screen", and trigger the code from there. You could make it a "Welcome" screen with just a message on which stays there for a few seconds, or have it closed by the user. Just pick that form in the Startup --> Display Form/Page.
 
reclusivemonkey said:
One way would be to set up a "Splash Screen", and trigger the code from there. You could make it a "Welcome" screen with just a message on which stays there for a few seconds, or have it closed by the user. Just pick that form in the Startup --> Display Form/Page.

Hi,

I think the question has been misunderstood. There are 2-3 users to the system and each of them have their own front end. I want the first user to load the tables when he or she logs on. The code for loading the table is in the Form Open event. Subsequent users who logon should not repeat the process of loading the tables. Ideally this event of loading the table will happen only once in a day.

If database backend not open (no other user logged on yet)
.....Load tables from spreadsheets
else
.....Just open form
end if


The bit that I want help on is ' checking of backend database is already open'

Thanks,
Priya
 
This came right out of the MS Access help file:

Control how an Access file looks and behaves when it opens

You can use startup options to specify, for example, what form to display, whether toolbars can be customized, and whether shortcut menus are available in your Microsoft Access file.

You can also use a special macro named AutoExec to carry out an action or series of actions when your database first opens. When you open a database, Microsoft Access looks for a macro with this name and, if it finds one, runs it automatically.
 
Reclusive Monkey is on the right track, but needs to add a twist. You can add a table in the backend that stores a date. This one date would be checked when the database is opened and if it isn't "today's date" then it would run the code and then update the table with the date. Once that has been run the code to update the tables wouldn't run again since the date would match today's date.
 

Users who are viewing this thread

Back
Top Bottom