Microsoft Access 2010 Bible

(Rick Simeone) #1

Part IV: Professional Database Development


916


l (^) Buttons: A numeric expression that defines the number and type of buttons to display in
the message box, the icon style to use, which button to use as the default button, and the
modality of the message box. The Buttons parameter completely defines the nature of
the message box; therefore, there are many different values for this parameter. Table 26.1
contains all the possible values. If omitted, the default value for Buttons is 0.
l Title: The text to display in the title bar of the message box. If you omit the title, the name
of the application is used in the title bar.
l HelpFile: A string that is the name of the Help file to use to provide help for the dialog
box. If the HelpFile parameter is provided, the Context parameter must also be
provided.
l (^) Context: The help context number assigned to the message-box help topic. If the
Context parameter is provided, HelpFile must also be provided.
Table 26.1 lists the valid values for the Buttons parameter. When more than one button or
setting is required, sum the Constant values and pass the total to the MsgBox() function.
TABLE 26.1


MsgBox Button Constants


Button Constant Value Description
vbOKOnly 0 Display only the OK button.
vbOKCancel^1 Display the OK and Cancel buttons.
vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
vbYesNoCancel 3 Display Yes, No, and Cancel buttons.
vbYesNo 4 Display Yes and No buttons.
vbRetryCancel 5 Display Retry and Cancel buttons.
vbCritical 16 Display Critical Message icon.
vbQuestion 32 Display Warning Query icon.
vbExclamation 48 Display Warning Message icon.
vbInformation 64 Display Information Message icon.
vbDefaultButton1 0 The first button in the message box is default.
vbDefaultButton2 256 The second button in the message box is default.
vbDefaultButton3^512 The third button in the message box is default.
vbDefaultButton4 768 The fourth button in the message box is default.
vbApplicationModal^0 Make the message box application modal — the user must
respond to the message box before continuing work in the current
application.
vbSystemModal 4096 Make the message box “System modal” — all applications are
suspended until the user responds to the message box.
Free download pdf