Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 
Glossary

New Entries Added Almost Daily!
Click here to get on our Mailing List

   

   Access    Excel    Word    Windows    HTML

 
MS Access

MsgBox

Using the MsgBox Function

In this tutorial you will learn how to use the MsgBox Function.

The MsgBox function displays a message in a dialog box, waits for the user to click a button, and returns an Integer indicating which button the user clicked.

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

prompt The message to show the user.
buttons Which button(s) and/or icon(s) to show
title The title shown in the dialog box title bar
helpfile The helpfile used to provide added information
context The topic number assigned in the helpfile

MsgBox - Function Engine

Settings

The buttons argument settings are:

buttons
ConstantValueDescriptionImages
vbOKOnly0Display OK button only.Ok
vbOKCancel1Display OK and Cancel buttons.OkCancel
vbAbortRetryIgnore2Display Abort, Retry, and Ignore buttons.AbortRetryIgnore
vbYesNoCancel3Display Yes, No, and Cancel buttons.YesNoCancel
vbYesNo4Display Yes and No buttons.YesNo
vbRetryCancel5Display Retry and Cancel buttons.RetryCnacel
vbCritical16Display Critical Message icon.X
vbQuestion32Display Warning Query icon.?
vbExclamation48Display Warning Message icon.!
vbInformation64Display Information Message icon.i
vbDefaultButton10First button is default.
vbDefaultButton2256Second button is default.
vbDefaultButton3512Third button is default.
vbDefaultButton4768Fourth button is default.
vbApplicationModal0Application modal; the user must respond to the message box before continuing work in the current application.
vbSystemModal4096System modal; all applications are suspended until the user responds to the message box.
vbMsgBoxHelpButton16384Adds Help button to the message boxHelp
VbMsgBoxSetForeground65536Specifies the message box window as the foreground window
vbMsgBoxRight524288Text is right alignedvbMsgBoxRight
vbMsgBoxRtlReading1048576Specifies text should appear as right-to-left reading on Hebrew and Arabic systemsvbMsgBoxRtlReading

The Return Values:

Return Values
ConstantValueDescription
vbOK1OK
vbCancel2Cancel
vbAbort3Abort
vbRetry4Retry
vbIgnore5Ignore
vbYes6Yes
vbNo7No


Course(s)

Access 2013 Access Expert 16

Access 2003 Access 204 | Access 2003 Access 222

Seminar(s)

Access 2007 Access Data Encryption | Access 2007 Access Email | Access 2007 Access Payables | Access 2007 Access Search | Access 2007 Access Security | Access 2007 Access Work Order

Tip

See this FREE Tip on MsgBox.

Search

You can find more about this by searching the website.


Alex Hedley (Avatar) By: Alex Hedley


Click here to sign up for more FREE tips

 

You may want to read these articles from the 599CD News:

 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About Us
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP