Solved

Multiline msg box

Posted on 2013-11-14
7
350 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 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses
Course of the Month5 days, 10 hours left to enroll

626 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