How can I get a "Are you sure you want to quit YES/NO" prompt on an access button
<p>I have a quit button in Access 2007 called cmdQuit -</p>

<p>How I can have it so it brings up a warning prompt along the lines of 
are you sure you want to quit? YES/NO</p>

<p>So that it doesn't just automatically quit the log form? </p>

<p>I have this as my command:</p>

<p>Private Sub cmdQuit_Click()</p>

<pre><code>If MsgBox("Are you sure that you want to close this form?", vbYesNo) = vbYes Then
    Exit Sub
Else
    Cancel = True
End If
</code></pre>

<p>End Sub</p>

<p>So the No part of the prompt works but the Yes and then quit part does not</p>

<p>Thanks
Dan</p>