• Autoexec macro (Access 2000)

    Author
    Topic
    #366964

    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

    Viewing 0 reply threads
    Author
    Replies
    • #570990

      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?

    Viewing 0 reply threads
    Reply To: Autoexec macro (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: