Message Box

I have a Microsoft Access dataabse. In this database I have a form with a button on it. After the botton is clicked I would like a message box displayed asking "would you like to run this command: yes,no, or cancle"... Any suggestions
Will_PAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
omgangConnect With a Mentor Commented:
Dim intResponse As Integer
Dim strMsg As String

strMsg = "Would you like to run this command?"

intResponse = MsgBox(strMsg, vbYesNoCancel, "Make A Choice")
If intResponse = vbYes Then
    'Do Something
ElseIf intResponse = vbNo Then
    'Do  Something else
End If

OM Gang
0
 
satshahCommented:
Access uses VB script so you can use following syntax.

MsgBox(prompt [, buttons ] [, title ] [, helpfile ] [, context ] )

more info then follow this link

http://office.microsoft.com/en-us/access-help/msgbox-function-HA001228886.aspx
0
 
Rey Obrero (Capricorn1)Commented:
private sub button_click()

msgbox "Would you like to run this command?",vbyesnocancel

end sub


explain what needs to be done for each option selected
0
 
Will_PAuthor Commented:
The solution was perfect! All I had to do was enter my command inside of the if then statement
0
All Courses

From novice to tech pro — start learning today.