Full Version: New Paragraph In Long Message Box Type
UtterAccess Forums > Microsoft® Access > Access Forms
rmc123
Is there a way, in the code of a msgbox, to tell the msgbox that you want to start a new paragraph, and continue typing the message in the code? I have very long instructions in my msgbox and I would like to break it into paragraphs.

Thanks so much!
Rose Mary
Bob G
have you considered using a pop-up form instead of a message box?
Garfieldm842
vbCrLf

This at the end of a line will tell it to go to the next line.

"Step 1) You must" & vbcrlf
"Step 2) And then"
rmc123
Hi Garfieldm842

The following is my paragraph. I am not doing it right. Please tell me how to place the quotes because I keep getting an unexpected end of statement error:

MsgBox "If you have additional medical notes that you would like to add to the 'Additional Medical Notes' section, write them on a sheet of paper, and add them after the appointment has been scheduled so that you do not take too long in scheduling the person. & vbcrlf Select the Call Status, which should be 'Scheduled', from the drop down Status Combo Box located under the Phone Details button in the upper right area of your screen, then press the 'Save your Answers' button to save your answers amd return to the prior screen. & vbcrlf After you return to the prior screen, press the Scheduled Button at the top of your screen to advance to the Scheduling section so that you may schedule the appointment.", vbOKOnly, "Save Your Answers"

Bob G: This msgbox is already being displayed in a popup form therefore I would prefer to use Garfield's method if I can get it to work.

Thanks so much!

Rose Mary
Garfieldm842
button to save your answers and return to Change "AMD --> AND")

MsgBox "If you have additional medical notes that you would like to add to the 'Additional Medical Notes' section, write them on a sheet of paper, and add them after the appointment has been scheduled so that you do not take too long in scheduling the person." & vbcrlf
"Select the Call Status, which should be 'Scheduled', from the drop down Status Combo Box located under the Phone Details button in the upper right area of your screen, then press the 'Save your Answers' button to save your answers and return to the prior screen." & vbcrlf
"After you return to the prior screen, press the Scheduled Button at the top of your screen to advance to the Scheduling section so that you may schedule the appointment.", vbOKOnly, "Save Your Answers"

OR

dim strMyText as string

strMyText="If you have additional medical notes that you would like to add to the 'Additional Medical Notes' section, write them on a sheet of paper, and add them after the appointment has been scheduled so that you do not take too long in scheduling the person." & vbcrlf
"Select the Call Status, which should be 'Scheduled', from the drop down Status Combo Box located under the Phone Details button in the upper right area of your screen, then press the 'Save your Answers' button to save your answers and return to the prior screen." & vbcrlf
"After you return to the prior screen, press the Scheduled Button at the top of your screen to advance to the Scheduling section so that you may schedule the appointment."

MsgBox strMyText, vbOKOnly, "Save Your Answers"
rmc123
Hi Garfield:

I found my error. The Msgbox sentence has to be all on one line and I was putting the sentences after the vbCrLF on new lines and that is why I was getting the error. I used to be able to put a _ after a line of vb code to go to the next line in vb without having a super long line, but this doesn't work anymore. I thought that the vbCrLF would do the same thing in the vbcode but it doesn't. You have to put the long msgbox sentence all on one line.

Thanks so much for your help!

Rose Mary
dmhzx
When building up a long string you need & _ at the end.

msg = "Please note the following " & vbcrlf & _
"1 Do this . " & vbcrlf & _
" Then do that"


msgbox msg, vbokonly

Note this this structure is very much the same as Garfield has offered. It's been done to show how to keep it all in the working window.
Bob G
what i was suggesting was not a popup form that had a message box. I was suggesting using a popup form AS the message box. Then you can highlight, change font or any other setting that might be visually helpful
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.