Results 1 to 2 of 2
Thread: Autoexec macro (Access 2000)
2002-02-17, 09:40 #1
- Join Date
- Nov 2001
- Thanked 0 Times in 0 Posts
Autoexec macro (Access 2000)
I have a function which sends objects only in case a database exists(in my case wpath, which shows the path of the database). If the database does not exist, then the database should be closed.
My function called stow works fine with the OnClick event in a form.Then the database is closed in case wpath does not exist However i am using this function within an autoexec macro.In fact the autoexec macro opens a form and the form triggers the function stow.In this case the database is neither closed nor opened and a message appears" cannot find the path." Actually my target us fulfilled, not to open the database in case wpath is not available,but i want to avoid this message
to give a better appearance or polish the performance. In two words, to quit the database without any further messages. Obvisouly the autoexec macro inteferes somehow with the command.
How can i avoid the appearance of the message? I have tried with DoCmd.SetWarning false but with no success.
Public Function stow()
If Dir(wpath, vbNormal) <> "" Then
DoCmd.TransferDatabase acExport, "Microsoft Access", wpath, acTable, "orders", "orders1"
2002-02-17, 16:39 #2
- Join Date
- Dec 2000
- Sacramento, California, USA
- Thanked 1 Time in 1 Post
Re: Autoexec macro (Access 2000)
Why aren't you using error handling to trap the error in your routine, or did you just leave that out when posting the code here?Charlotte