Solved

Message Box

Posted on 2011-03-24
4
260 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 119

Expert Comment

by:Rey Obrero
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now