Results 1 to 8 of 8
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Format vbInformation Msg (2002)

    Is there a way to "format" the vbInformation msg display (force second line)? So that:

    "Such and such a statement"

    Displays as:

    "Such and such
    a statement"

    I suppose the next question would be whether you can use "bold", "underline", etc.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Format vbInformation Msg (2002)

    Yes you can.

    msgbox("Such and such" & vbNewLine & " a statement")
    Regards
    John



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

    Re: Format vbInformation Msg (2002)

    You can insert a line break as follows:

    MsgBox "This is the first line." & vbCrLf & "This is the second line", vbInformation.

    If you want extended formatting, you need to create a form and open it as a dialog. You can format labels, put images on the form etc.

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Format vbInformation Msg (2002)

    Hans:

    Thanks!! It always looks so much better when the msg is actually narrower than the form <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>

    Extended formatting? Oh, dear professor, you should know better by now than to dangle that kind of carrot in front of me. Got any code example of an "If' statement that calls a custom dialog form, and redirects focus to another control? <img src=/S/bow.gif border=0 alt=bow width=15 height=15>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Format vbInformation Msg (2002)

    Further to my previous reply, have a look at the thread beginning with <post#=35,509>post 35,509</post#> .

    Using Access 2003, I just found that if you display the message box with a macro, rather than using VBA, the formatting that used to work, still does.

    In the macro , you can divide the message intwo three sections with @ separting them. The first bit is shown in bold, as heading. the second and third bits are displayed on separte lines: Heading@lineone@linetwo shows as:
    heading
    lineone
    linetwo
    Regards
    John



  6. #6
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Format vbInformation Msg (2002)

    John:

    Ooops! Sorry pal, I replied to Hans when your post was the one that gave me the answer to the original question.
    (This is a prime example of my natural state of confusion)
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

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

    Re: Format vbInformation Msg (2002)

    Something like

    If <somecondition> Then
    DoCmd.OpenForm FormName:="frmMyMessage", WindowMode:=acDialog
    Me.SomeControl.SetFocus
    End If

  8. #8
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Format vbInformation Msg (2002)

    Hans:

    Oh, that's really cool. . . <img src=/S/cool.gif border=0 alt=cool width=15 height=15>
    (One more "toy" for me to screw things up with) <img src=/S/yep.gif border=0 alt=yep width=15 height=15>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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