views:

33

answers:

1

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
A: 

Configure the folder where the database resides as a Trusted Location. See "Create, remove, or change a trusted location for your files" for detailed instructions.

HansUp