I'm adding some custom buttons to my forms in MS Access, but somehow I can't make them work. In buttons properties Event tab I've changed 'On Click' event to call 'Event procedure'. Then in VBasic I'm selecting my button and from what I know this code should give me prompt, and if Yos is selected the form should close. But when I click my buttons simply nothing happens. Am I doing something wrong ?
Option Compare Database
Option Explicit
Private Sub cmdQuitApp_Click()
If MsgBox("Are you sure you want to close the form?", vbYesNo + vbQuestion + vbInformation, "Clasing the form.") = vbYes Then
DoCmd.Close
End If
End Sub