Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a multi-line msg box in Access 2000 / 2002

How To

How do I create a multi-line msg box in Access 2000 / 2002

by  jmeadows7  Posted    (Edited  )
The answer is to create a function and then substitute the function name in your code in place of the normal MsgBox function.

--- your code inside your event
FormattedMsgBox "Invalid Ticket Range!@Please Correct!@", vbOKOnly + vbInformation, "Information"
----

Insert the function below into your project/database:

Function FormattedMsgBox(Prompt As String, _
Optional Buttons As VbMsgBoxStyle = vbOKOnly, _
Optional Title As String = "Microsoft Access", _
Optional HelpFile As Variant, _
Optional Context As Variant) As VbMsgBoxResult
Dim strMsg As String
If IsMissing(HelpFile) Or IsMissing(Context) Then
strMsg = "MsgBox(" & Chr(34) & Prompt & Chr(34) & ", " & Buttons & _
", " & Chr(34) & Title & Chr(34) & ")"
Else
strMsg = "MsgBox(" & Chr(34) & Prompt & Chr(34) & ", " & Buttons & _
", " & Chr(34) & Title & Chr(34) & ", " & Chr(34) & _
HelpFile & Chr(34) & ", " & Context & ")"
End If
FormattedMsgBox = Eval(strMsg)
End Function
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top