UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Problem with concatenated text box    
 
   
littlethief
post May 20 2008, 11:09 AM
Post #1

UtterAccess Member
Posts: 48



I have a report that concatenates the City, State and Zip Code fields:
CODE
=[Provider_City] & ", " & [Provider_State] & " " & [Provider_Zip]


All of a sudden, if a zip code has a hypen, instead of coming out as 45429-1298, it will come out as 454291298.

Nothing has changed but we can't figure out why it's happening. Can anyone help with this?

Thanks!
Go to the top of the page
 
+
dberninger
post May 20 2008, 11:34 AM
Post #2

UtterAccess Addict
Posts: 162
From: Indiana, US



I'd like to help but there is a question first.

The provider_zip is usually stored as two seperate fields, the first five and the optional last 4. Are you doing a concatenation on these fields to create the one number with the hyphen?
Go to the top of the page
 
+
littlethief
post May 20 2008, 11:50 AM
Post #3

UtterAccess Member
Posts: 48



No, it's stored in one field with an input mask.
Go to the top of the page
 
+
rbianco
post May 20 2008, 12:04 PM
Post #4

UtterAccess VIP
Posts: 1,730
From: Carrollton, TX



Are you applying the Zip Code Input mask at the design level of the table where you are storing the zip code information? If so, this puts your zip plus 4 into one field and your above result is "normal" when concatenating it all into one string.

One fix is to do this at point of concatenating:
=[Provider_City] & ", " & [Provider_State] & " " &IIf(Len([Provider_Zip])<9,Left([Provider_Zip],5),Left([Provider_Zip],5) & "-" & Right([Provider_Zip],4))
Go to the top of the page
 
+
littlethief
post May 20 2008, 12:26 PM
Post #5

UtterAccess Member
Posts: 48



That worked. Thank you so much!!!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th June 2013 - 12:26 AM