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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto start macro for one time only

Status
Not open for further replies.

fatchoy

MIS
Jul 19, 2001
31
JP
Hi

I am now using a macro named as 'Autoexec' so that it will
auto start the macro whenever i open access database.

My question here is whether how can i only auto start the macro for one time only so that the next time i open the access database it will no longer auto start the macro.

Thanks in advance
 
Three dull ways come to mind:

Flag file
.INI file
registry

Are you familiar with WritePrivateProfileString, et al?

A quick and dirty way would be to use a flag file, a la,
sub foo
does file exist
if so exit sub
create the file
{your one-time-only-code here}

Is that okay?
 
this may sound like a dumb question... but why have some thing run just once??

do you mean once a day, just the first time in a day?? or just the first time period?? if it's just the first time period, i wouldn't do it programaticly, because that code will alwas run on startup, and slow down the starting of the mdb... just a few thoughts...

--Junior JHauge@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top