Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    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"
    Application.Quit acPrompt
    DoCmd.SetWarnings False
    End If
    End Function

  2. #2
    Plutonium Lounger
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts