Solved

Multiline msg box

Posted on 2013-11-14
7
344 Views
Last Modified: 2013-11-14
I have this msg box I'd like to make:

Full Member - A member 18 or older not living with parent.  Must reside within 25 miles of the club.

Associate Member - A member 18 or older not living with parent.  Lives outside of 25 miles from the club.

Senior Member - A member 65 or older that has 5 contiguous years of club membership as the last prior 5 years.

Junior Member - A member that is under 18 on January 1st of the next year.

Family Member Under 18 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home and is under 18 on January 1st of the next year.

Family Member Under 21 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home and is under 21 on January 1st of the next year.

Husband/Wife Member - Members that are legally married.  Couples cohabitating are considered individual members.

This is what I've tried but vb doesn't like it and I don't know why.  I get the compile error: expected end of statement but everything looks correct.

MsgBox "Full Member - A member 18 or older not living with parent.  Must reside within 25 miles of the club." & vbCrLf& _
    &vbCrLf& "Associate Member - A member 18 or older not living with parent.  Lives outside of 25 miles from the club." & vbCrLf& _
    &vbCrLf& "Senior Member - A member 65 or older that has 5 contiguous years of club membership as the last prior 5 years." & vbCrLf& _
    &vbCrLf& "Junior Member - A member that is under 18 on January 1st of the next year." & vbCrLf& _
    &vbCrLf& "Family Member Under 18 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home" & vbCr& _
    &vbLf& "and is under 18 on January 1st of the next year." & vbCrLf& _
    &vbCrLf& " Family Member Under 21 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home" & vbCr& _
    &vbLf& "and is under 21 on January 1st of the next year." & vbCrLf& _
    &vbCrLf& "Husband/Wife Member - Members that are legally married.  Couples cohabitating are considered individual members.", vbInformation, "Membership Definitions"

Thanks,
Ric
0
Comment
Question by:Joppa
7 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 250 total points
ID: 39647819
test this


MsgBox "Full Member - A member 18 or older not living with parent.  Must reside within 25 miles of the club." & vbCrLf _
    & vbCrLf & "Associate Member - A member 18 or older not living with parent.  Lives outside of 25 miles from the club." & vbCrLf _
    & vbCrLf & "Senior Member - A member 65 or older that has 5 contiguous years of club membership as the last prior 5 years." & vbCrLf _
    & vbCrLf & "Junior Member - A member that is under 18 on January 1st of the next year." & vbCrLf _
    & vbCrLf & "Family Member Under 18 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home" _
    & "and is under 18 on January 1st of the next year." & vbCrLf _
    & vbCrLf & " Family Member Under 21 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home" _
    & "and is under 21 on January 1st of the next year." & vbCrLf _
    & vbCrLf & "Husband/Wife Member - Members that are legally married.  Couples cohabitating are considered individual members.", vbInformation, "Membership Definitions"
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points
ID: 39647828
You have missed out spacing before and after the concatenation operator(&). Also you have some consecutive ampersands (at the end of a line, and then on the next line). Try this:
MsgBox "Full Member - A member 18 or older not living with parent.  Must reside within 25 miles of the club." & vbCrLf & _
    vbCrLf & "Associate Member - A member 18 or older not living with parent.  Lives outside of 25 miles from the club." & vbCrLf & _
    vbCrLf & "Senior Member - A member 65 or older that has 5 contiguous years of club membership as the last prior 5 years." & vbCrLf & _
    vbCrLf & "Junior Member - A member that is under 18 on January 1st of the next year." & vbCrLf & _
    vbCrLf & "Family Member Under 18 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home" & vbCr & _
    vbLf & "and is under 18 on January 1st of the next year." & vbCrLf & _
    vbCrLf & " Family Member Under 21 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home" & vbCr & _
    vbLf & "and is under 21 on January 1st of the next year." & vbCrLf & _
    vbCrLf & "Husband/Wife Member - Members that are legally married.  Couples cohabitating are considered individual members.", vbInformation, "Membership Definitions

Open in new window

"
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39647921
Graham,

Your last quotation mark accidentally wound up outside of the code box.

No points for this correction, please.  The last comment should have been:

MsgBox "Full Member - A member 18 or older not living with parent.  Must reside within 25 miles of the club." & vbCrLf & _
    vbCrLf & "Associate Member - A member 18 or older not living with parent.  Lives outside of 25 miles from the club." & vbCrLf & _
    vbCrLf & "Senior Member - A member 65 or older that has 5 contiguous years of club membership as the last prior 5 years." & vbCrLf & _
    vbCrLf & "Junior Member - A member that is under 18 on January 1st of the next year." & vbCrLf & _
    vbCrLf & "Family Member Under 18 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home" & vbCr & _
    vbLf & "and is under 18 on January 1st of the next year." & vbCrLf & _
    vbCrLf & " Family Member Under 21 - A child of a Full, Associate, Senior, or Husband/Wife member that is residing at home" & vbCr & _
    vbLf & "and is under 21 on January 1st of the next year." & vbCrLf & _
    vbCrLf & "Husband/Wife Member - Members that are legally married.  Couples cohabitating are considered individual members.", vbInformation, "Membership Definitions" 

Open in new window

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39647938
Thanks mbizup.
0
 

Author Comment

by:Joppa
ID: 39647986
Well, you know I had to try them both and of course they both worked.  I guess my eyes are getting tired and didn't see this(better then saying old).

Thanks,
Ric
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39648144
Thanks again mbizup.

Joppa,
Your eyes are OK.
The code worked without the trailing " because a VB automatically appends one at the end of the line if there is an odd number of string delimiting quotes in the text.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question