Custom buttons in MS-Access 2k7

Posted by terence6 on Stack Overflow See other posts from Stack Overflow or by terence6
Published on 2010-06-03T00:21:15Z Indexed on 2010/06/03 1:04 UTC
Read the original article Hit count: 301

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

© Stack Overflow or respective owner

Related posts about ms-access

Related posts about visual-basic