MsgBox Question

  • Thread starter Thread starter Anthony Viscomi
  • Start date Start date
A

Anthony Viscomi

How can I get the following message to appear on multiple lines within a
msgbox?

MsgBox Err.Description & " For 1 of the following reasons: You are at either
the first or last record or Required Data is Missing (Delete Record)."

Thanks!
Anthony
 
Great! Thanks.
Nick Coe (UK) said:
Concatenate your message string with vbCrLf which is the vb/vba
representation of a carriage return/line feed pair.

Dim strMsg As String

strMsg = " For 1 of the following reasons:" & vbCrLf
strMsg = strMsg & "You are at either the first or last record" & vbCrLf
strMsg = strMsg & "or Required Data is Missing (Delete Record)."

MsgBox Err.Description & strMsg

--
Nick Coe (UK)
AccHelp v1.01 Access Application Help File Builder
http://www.alphacos.co.uk/
Download Free Copy
 
Concatenate your message string with vbCrLf which is the
vb/vba representation of a carriage return/line feed pair.

Dim strMsg As String

strMsg = " For 1 of the following reasons:" & vbCrLf
strMsg = strMsg & "You are at either the first or last
record" & vbCrLf
strMsg = strMsg & "or Required Data is Missing (Delete
Record)."

MsgBox Err.Description & strMsg
 
Try this

Dim strText As String

strText = "Line 1" & vbNewLine _
& "Line 2" & vbNewLine _
& "Line 3" _
(etc.... Don't use continuation underscore on last line)

MsgBox Prompt:= Err.Description & strText

Regards
Nigel
 
Back
Top