Solved

Multiline msg box

Posted on 2013-11-14
7
330 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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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.

707 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

17 Experts available now in Live!

Get 1:1 Help Now