Ana_T said:
Hi,
I'd like Access to run a routine at power up something like:
If the file name at \\server\test\file1.mdb is different from the actual
one then display msg "Update file".
Can it be done and if so, how?
If you test for "\\server\test\file1.mdb", the specified file may exist or
not, but will not return a different file name.
On the menu, Tools | Startup will allow you to specify a particular Form to
be displayed... code in the Open or Load events of that Form will execute
automatically.
In a module window, check help on the "Dir" function... that should return
the name if it exists. If that name does not exist, then use the MsgBox
statement to display the message. You can easily find the Help in the
module window... put the cursor in the word (in this case Dir or MsgBox) and
press F1. The word you use can even be in a comment, sometimes convenient
to prevent forgetting to remove it and then getting compile errors.
Larry Linson
Microsoft Access MVP