Purpose
The MessageBox function displays a message in a message box. The message can be a static text or a value retrieved from a control. Optionally, a title, button type, and maximum message length can be specified.
Syntax
MessageBox(Message, Optional:Title, Optional:ButtonType:OK/OKCancel, Message Length)
Arguments
1. Message – Message to be displayed
2. Title – Title of message box
3. Button Type – Button types: OK/OKCancel
4. Message length – Maximum length of the message
Example
MessageBox(txtErrorMessage.Value, “Error Handler”, OKCancel, 50)
Displays the value of txtErrorMessage in a message box titled “Error Handler” with OK and Cancel buttons. The displayed message is limited to a maximum of 50 characters.


If the ButtonType argument is set to OK, the message box displays only the OK button.
Example:
MessageBox(“An error occurred while processing your request.”, “Error”, OK)
