Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Posts
    280

    Unanswered: How do you create a messagebox that look like a report?

    Is it possible?

    For example:

    Donny Hue
    12312 North Wind Blvd.
    Baton Rouge, LA 23234

    Owe: $2422
    Due:3/1/2004

    It would show on a single line for each data.

  2. #2
    Join Date
    Apr 2002
    Location
    Illinois
    Posts
    133

    Re: How do you create a messagebox that look like a report?

    Originally posted by lansing
    Is it possible?

    For example:

    Donny Hue
    12312 North Wind Blvd.
    Baton Rouge, LA 23234

    Owe: $2422
    Due:3/1/2004

    It would show on a single line for each data.
    It's possible and not too hard. Create variables to hold the pieces of info, i.e. name, address, city, etc. Then build a string for the message box using the vba carriage return characters (vbLf) to force new lines:

    strMessage = <fullName> & vbLf & <address> & vbLf & <cityStateZip> & vbLf & vbLf & "Owe: " & <amountOwed> & vbLf & "Due: " & <dueDate>

    Msgbox (strMessage)

    This will work for small amounts of info.
    SteveH

  3. #3
    Join Date
    Apr 2003
    Posts
    280

    Re: How do you create a messagebox that look like a report?

    Originally posted by SteveH
    It's possible and not too hard. Create variables to hold the pieces of info, i.e. name, address, city, etc. Then build a string for the message box using the vba carriage return characters (vbLf) to force new lines:

    strMessage = <fullName> & vbLf & <address> & vbLf & <cityStateZip> & vbLf & vbLf & "Owe: " & <amountOwed> & vbLf & "Due: " & <dueDate>

    Msgbox (strMessage)

    This will work for small amounts of info.
    I always curious why programmer put strings in a variable to called the string out.

    My thought is, if your only using the string once, why put it in a variable. Is it a coding habit?

    Anyways, thanks for the code. I haven't try it yet, but it should work from just looking at it.

Posting Permissions

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