Solved

Message Box

Posted on 2011-03-24
4
268 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:Will_P
4 Comments
 
LVL 1

Expert Comment

by:satshah
ID: 35206852
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
 
LVL 28

Accepted Solution

by:
omgang earned 500 total points
ID: 35206870
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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35206879
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
 

Author Closing Comment

by:Will_P
ID: 35207450
The solution was perfect! All I had to do was enter my command inside of the if then statement
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question