Solved

Multiline msg box

Posted on 2013-11-14
7
334 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 119

Assisted Solution

by:Rey Obrero
Rey Obrero 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sending email from List Data 2 50
Before insert Image (OLE) resize image 11 41
sort Time by AM and PM in query 2 18
Access Excel export not behaving 2 24
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now