Closing Database using a Quit Button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SoNew
    New Member
    • Mar 2008
    • 13

    #1

    Closing Database using a Quit Button

    I have designed a database and have used the following code to disable the standard Microsoft close button. I want my users to have to click on a Quit button on the switchboard:

    Private Sub Form_Unload(Can cel As Integer)
    Dim LResponse As Integer

    LResponse = MsgBox("Please Use Quit Button on Main Menu", vbOKOnly)
    If LResponse = vbOK Then
    Cancel = True
    End If

    End Sub

    They get a pop-up reminder that they have to press OK on - which works well - nothing closes. The problem is that they then get the same reminder when they actually press the Quit button - when the press OK it then closes the database, but I want it to close without having to have this pop-up on the Quit Click.
    Anyone got any code for this?
    Thanks!
    EAC
  • SoNew
    New Member
    • Mar 2008
    • 13

    #2
    MOVING TO ACCESS VBA.
    CLOSE Thread

    Comment

    Working...