Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage returns in expressions

Status
Not open for further replies.

Catadmin

Programmer
Oct 26, 2001
3,097
US
Just learned this myself and thought I'd pass it along.

If you need a carriage return or line break between phrases in an expression, you can use the abreviation "vbcrlf". For example, if you're doing a mailing list and want to stick two address lines (street address and apartment #) into one textbox, you can do the following:

Code:
= iif(isnothing(Fields!Addr2.Value), Fields!Addr1.Value, Fields!Addr1.Value  & vbcrlf &  Fields!Addr2.Value)

The above code tests the 2nd address field for a null or blank value. If it does have null or blank, it only prints the first address field. If the 2nd address field has a valid value, it will print the first address field with the second address field on a second, seperate line.

Apparently, this carriage return also works in charts, though I have yet to test that feature.

Hope that helps someone!

Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top