Quip App Command Button

YNWA

Registered User.
Local time
Today, 14:45
Joined
Jun 2, 2009
Messages
905
Hi,

Is there a way to warn the user they are closing the whole database down when they click the Close App button?

I have the code:

Code:
Private Sub cmd_Quit_Click()
On Error GoTo Err_cmd_Quit_Click

    If Me.Dirty Then Me.Dirty = False
    DoCmd.Quit
Exit_cmd_Quit_Click:
    Exit Sub
Err_cmd_Quit_Click:
    MsgBox Err.Description
    Resume Exit_cmd_Quit_Click
    
End Sub

Cheers
WIll
 
This code is from a Command Button on a form is that correct WIll ?

If so you would add a msgbox

so it would be something like

msgbox"You have selected to close the Database"

Which could go before the

DoCmd.Quit line
 
This code is from a Command Button on a form is that correct WIll ?

If so you would add a msgbox

so it would be something like

msgbox"You have selected to close the Database"

Which could go before the

DoCmd.Quit line

Hi, yes thats great.

However, instead of warning the user and the only option being OK then closing. Is it possible to have the warning give options of Yes and No?

Eg. Do you wish to close the database?
YES - No
 
You want to look at the help area of access VBA there is information about this, but you would need something like.

Dim LResponse As Integer
LResponse = MsgBox("Do you want to close the database", vbYesNo, "Test")
If LResponse = vbYes Then
DoCmd.Quit
Else
Exit Sub
End If
 
hi, try to use this codes; hope it will help you


Code:
__________________________________________________
Private Sub cmd_Quit_Click()
On Error Resume Next
If MsgBox(" Close Current Database?", vbYesNo + vbQuestion, "System Message") = vbYes Then
DoCmd.Quit

Else

Cancel = true

End If


End Sub

_________________________________________________________________
I'm still learning yet, i just want to share some knowledge if it can help.hope it can so!!!
 
Last edited:
hi, try to use this codes; hope it will help you


Code:
__________________________________________________
Private Sub cmd_Quit_Click()
On Error Resume Next
If MsgBox(" Close Current Database?", vbYesNo + vbQuestion, "System Message") = vbYes Then
DoCmd.Quit

Else
Cancel = true

End If

End Sub
_________________________________________________________________
I'm still learning yet, i just want to share some knowledge if it can help.hope it can so!!!

Works a treat. Thanks very much.
 

Users who are viewing this thread

Back
Top Bottom