Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: Access Modules (VBA Coding) FAQ

How To

How do I create a multi-line msg box in Access 2000 / 2002 by jmeadows7
Posted: 6 Jun 03

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) & ")"
       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

Back to Microsoft: Access Modules (VBA Coding) FAQ Index
Back to Microsoft: Access Modules (VBA Coding) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close