My Assistant
![]() ![]() |
|
|
Aug 6 2005, 02:28 PM
Post
#1
|
|
|
UtterAccess Addict Posts: 242 From: Long Island, New York |
I'm using access to print a letter to patrons. Not all of them have a company they are associated with so I have the following unbound text box which will print a company if there is one, but not leave a blank space if there is not:
=([First_Name]+" ") & ([Last_Name]+" ") & ([Company]+" ") & [Street] & [City] & ", " & [State] & " " & IIf(Len([zip])=5,Format([zip],"00000"),Format([zip],"00000-0000")) My problem is that it prints everything out on one continuous line and I want to add in line breaks to split it up. Can this be done? I've tried messing around with "vbcrlf" which I found searching on here, but I can't make it work. I can resort to putting everything on its own line but then if there is no company for that person there will be a blank line between their name and address which would look stupid. Any suggestions? |
|
|
|
Aug 6 2005, 03:53 PM
Post
#2
|
|
|
UtterAccess Veteran Posts: 435 From: Pax River, MD |
Try:
=([First_Name]&" ")&([Last_Name]&" ")&IIf(IsNull([Company]),"",Chr(13)&Chr(10)&[Company])&Chr(13)&Chr(10)&[Street]&[City]&", "&[State]&" "&IIf(Len([zip])=5,Format([zip],"00000"),Format([zip],"00000-0000")) vbCrLf is not recoqnized in SQL and therefore not in a control source either, it's purely for VBA. so use Chr(13)&Chr(10) -- carriage return & line feed (or vice versa) HTH, Gecko |
|
|
|
Aug 6 2005, 09:29 PM
Post
#3
|
|
|
UtterAccess Addict Posts: 242 From: Long Island, New York |
Thank you Gecko, that conecept worked perfectly, and thanks for fixing up my code a bit too.
I appreciate it so much. Thanks again!!! |
|
|
|
Aug 7 2005, 06:33 AM
Post
#4
|
|
|
UtterAccess Veteran Posts: 435 From: Pax River, MD |
Glad to help.
Gecko |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 22nd May 2013 - 06:55 AM |