Microsoft Access 2010 Bible

(Rick Simeone) #1

Part IV: Professional Database Development


904


One valuable technique used by many developers is to keep messages such as the one you see in
Figure 26.2 in a table within the database. Figure 26.3 shows such a table and a message box dis-
playing a message contained in this table.

On the CD-ROM
This table and the accompanying form (frmMessageDemo) are included in this chapter’s example database
(Chapter26.accdb) on this book’s CD-ROM.


Note
Just to be clear, frmMessageDemo isn’t actually a form you’d necessarily include in your application (unless
you created a version that allowed the users to change the actual error messages). It’s included here simply to
provide a convenient way to see what messages have been included in the application, and how they’ll look to
the end user.


FIGURE 26.2

The messages you provide your users don’t have to be extensive or sophisticated.


FIGURE 26.3

A simple message table and message box containing help text


In practice, the MessageID is used to reference a particular message in this table. You could store
the MessageID in the Tag field of a control or form and invoke the message when some error has
occurred or when the user presses a button on a form. The message could also be displayed in the
Free download pdf