Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multiline msg box

Posted on 2013-11-14
7
Medium Priority
?
357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 1000 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 1000 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

688 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