There is a wizard build into design view of your form.
Find the Button icon, click it and draw a button, then the wizard pops up, go through the selections and you should see Close Form, select it, OK, name it etc.. and OK.
There is a wizard build into design view of your form.
Find the Button icon, click it and draw a button, then the wizard pops up, go through the selections and you should see Close Form, select it, OK, name it etc.. and OK.
This is my code for when the user select the Quit Database button
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