Idenitfying the first time a database is run

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way in Access 2003 to identify the first time a newly installed
database is run? I want to add a module that is invoked on the first start up.
 
You can create a macro and name it "autoexec" It will run every time the
database opens. You can set it up so that it runs the first time and refers
to whatever module you want, then in your module, you can delete the macro so
that it won't run anymore.

One other way I do it is to create a table with one field and one record.
The field is a "yes/no". When the database opens to the first form, I have
the database check to see if the field in that particular table is true or
false, if false, I have it run my code. At the end of the code I have it
update that record to true so that it won't run the code anymore.

Either way should work.
 
Hi,

One way is to add a little table:

tblSettings
Setting: Text 50, Primary key
Value: Text 255

with one record
Setting, Value
"FirstTime", "emiTtsriF"

Then when your startup form loads, have it do something like this:

If DCount("*", "tblSettings", _
"Setting='FirstTime' & Value='emiTtsriF'") Then
Call FirstTimeProcedure
CurrentDB.Execute _
"DELETE FROM tblSettings WHERE Setting='FirstTime';"
End If
 
Back
Top