Prev | Current Page 1702 | Next

Michael R. Groh, Joseph C. Stockman, Gavin Powell, and Cary N. Prague

"Access 2007 Bible"


The Button value you provide MsgBox can be a combination of several options. For instance, the
following command pops up a message box containing the famous Are you sure? message seen
in many Windows applications. The message box contains Yes, No, and Cancel buttons:
iRetVal = MsgBox(???Are you sure????, _
vbQuestion + vbYesNoCancel, ???Confirm, please???)
Alternatively, a number can be used in place of the VBA intrinsic constants. The following statement
is equivalent to the previous example:
iRetVal = MsgBox(???Are you sure???, 35, ???Confirm, please???)
903
Bulletproofing Access Applications 28
The 35 is the sum of vbQuestion (value = 32) and vbYesNoCancel (value = 3). You??™ll
find using the VBA intrinsic constants is more self-explanatory. Figure 28-15 is an example of different
message boxes.
FIGURE 28-15
Message boxes come in a variety of sizes and display a number of different icons.
MsgBox(), like all VBA functions, returns a value. The value returned depends on which button
displayed on the message box is clicked by the user.


Pages:
1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714
kreskówki muza pl negocjacje w biznesie cb radia wizytówki