I am creating a customized ribbon and have figured out the code to include buttons to click, the option is to run a macro.
My question is can I convert the code below into a macro?
Private Sub ExtBtn_Click()
Msg = "Are you sure you want to close the database?"
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "You Are Closing The Database"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
MyString = "Yes"
DoCmd.Quit acQuitSaveAll
Else
MyString = "No"
DoCmd.CancelEvent
End If
End Sub