Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Norfolk, England
    Posts
    744
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Msgbox on multiple lines (2000)

    Hi,
    How do I get a message box to display text on multiple lines as opposed to one long on?

  2. #2
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Msgbox on multiple lines (2000)

    If you use this as a templated you should be able to find your way round it: -

    MsgBox "Letter Printed" & Chr(13) & Chr(10) & "Thank you"

    Let me know if you want further help and I will try.
    Best Regards,

    Luke

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Msgbox on multiple lines (2000)

    Luke already answered your question. In VBA, you can use vbCrLf instead of Chr(13) & Chr(10). And vbNewLine will do the same.

  4. #4
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Msgbox on multiple lines (2000)

    Will note this as easier to write that the other way. Thanks
    Best Regards,

    Luke

  5. #5
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Norfolk, England
    Posts
    744
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Msgbox on multiple lines (2000)

    Thanks for your advice, appreciated

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Msgbox on multiple lines (2000)

    Just a little tip to augment what others have said. In a module, I created a nl() function, for "new line". The function only has 1 line of code in it:
    nl = vbCrLf

    In your situation, its use would look like this:
    Msgbox "FirstLine" & nl() & "SecondLine"

    I can use my nl() function anywhere, even in queries where you can't use intrinsic contants and global variables. Comes in quite handy.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  7. #7
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Msgbox on multiple lines (2000)

    You might want to take a look at <!post=this thread,35509>this thread<!/post> for more information on Message boxes - particularly how to embolden the first line.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  8. #8
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Msgbox on multiple lines (2000)

    Thanks Mark

    A nice "Top Tip", now filed in cabinet under U(seful code)

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •