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”
Application.Quit acPrompt
Else
DoCmd.SetWarnings False
Application.Quit
End If
End Function
-
Autoexec macro (Access 2000)
- This topic has 1 reply, 2 voices, and was last updated 23 years, 3 months ago.
AuthorViewing 0 reply threadsAuthorViewing 0 reply threads