Messagebox with go to next line

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want my messagebox to say the following how will I do it?
*******************************************
Please see me regarding the use of
"INTERNET"

If I agreed press Yes
if I did not agree press No

***************************************
I want it to appear as it is
 
Try this

MsgBox "Please see me regarding the use of " & Chr(10) & _
"INTERNET" & Chr(10) & Chr(10) & _
" If I agreed press Yes" & Chr(10) & _
"if I did not agree press No"
 
Thanks alot that worked

Ofer said:
Try this

MsgBox "Please see me regarding the use of " & Chr(10) & _
"INTERNET" & Chr(10) & Chr(10) & _
" If I agreed press Yes" & Chr(10) & _
"if I did not agree press No"

--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 
I have a question though about the line, I have that code in the before
update procedure, I would like when the user presses yes to go to the next
field, how will do that?
 
You can use that
Me.FieldName.SetFocus
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 
I tried doing that but its gviving me a runtime error 2108 "You must save the
field before you execute the GoToControl action, the GoToControl Method, or
the setFocus methods

response = MsgBox ("Please see me regarding the use of " & Chr(10) & _
"INTERNET" & Chr(10) & Chr(10) & _
" If I agreed press Yes" & Chr(10) & _
"if I did not agree press No",vbyesno)

if response = vbno then
cancel= true
else
cancel = false
me.reasons.setfocus
end if




....
 
On the before update have that
response = MsgBox ("Please see me regarding the use of " & Chr(10) & _
"INTERNET" & Chr(10) & Chr(10) & _
" If I agreed press Yes" & Chr(10) & _
"if I did not agree press No",vbyesno)

if response = vbno then
cancel= true
end if

On the after update have that

me.reasons.setfocus
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 
Better to use Chr(13) & Chr(10):

MsgBox "Please see me regarding the use of " & Chr(13) & Chr(10) & _
"INTERNET" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
" If I agreed press Yes" & Chr(13) & Chr(10) & _
"if I did not agree press No"

Or, use vbCrLf in place of the Chr(13) & Chr(10) combination.
 
Ken Snell said:
Better to use Chr(13) & Chr(10):

MsgBox "Please see me regarding the use of " & Chr(13) & Chr(10) & _
"INTERNET" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
" If I agreed press Yes" & Chr(13) & Chr(10) & _
"if I did not agree press No"

Or, use vbCrLf in place of the Chr(13) & Chr(10) combination.

I don't see why that's better, Ken. Although I was surprised that
Ofer's suggestion of using Chr(10) worked, it's documented that Chr(13)
alone -- or vbCr -- is accepted as a line break by the MsgBox function.
That being so, I habitually use vbCr alone in breaking up MsgBox text,
and have never had any problem come from it.

True, you can't do the same with text in a text box, or label
captions -- for them you have to have both the CR and the LF in
combination -- but as long as you know that MsgBox is different, why
bother using both control characters?
 
My suggestion is aimed at avoiding confusion by using different combinations
of these characters in different places in the database -- the Chr(10) won't
work for a new line in all cases. Perhaps a bit of "overstandardization" on
my part, but it's easier for me (and perhaps others?) to remember one
syntax.... < g >

--

Ken Snell
<MS ACCESS MVP>
 
Thanks, that solved the problem!

Ofer said:
On the before update have that
response = MsgBox ("Please see me regarding the use of " & Chr(10) & _
"INTERNET" & Chr(10) & Chr(10) & _
" If I agreed press Yes" & Chr(10) & _
"if I did not agree press No",vbyesno)

if response = vbno then
cancel= true
end if

On the after update have that

me.reasons.setfocus
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 
Thanks for the reply

Ken Snell said:
Better to use Chr(13) & Chr(10):

MsgBox "Please see me regarding the use of " & Chr(13) & Chr(10) & _
"INTERNET" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
" If I agreed press Yes" & Chr(13) & Chr(10) & _
"if I did not agree press No"

Or, use vbCrLf in place of the Chr(13) & Chr(10) combination.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top