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

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> #Error concatenating Address Information    
 
   
dashiellx2000
post Dec 6 2007, 08:38 AM
Post#1


UtterAccess VIP
Posts: 9,829
Joined: 11-March 05
From: Maryland


I am creating a label for mailing address bound to a query. Here is the query:
!--c1-->
CODE
SELECT tblInsuranceAddress.InsuranceAddressID, tblInsuranceAddress.InsuranceName,
tblInsuranceAddress.Attn, tblInsuranceAddress.Address1, tblInsuranceAddress.Address2, tblZipCodes.City,
tblZipCodes.State, tblZipCodes.ZipCode
FROM tblInsuranceAddress INNER JOIN tblZipCodes ON tblInsuranceAddress.ZipCodeID = tblZipCodes.ZipID;

THere is the Control Source of the Control on the report:
CODE
=([InsuranceName]+Chr(13)+Chr(10)) & ([Attn]+Chr(13)+Chr(10)) & ([Address1]+Chr(13)+Chr(10)) & _
([Address2]+Chr(13)+Chr(10)) & [City] & (", "+[State]) & ("  "+[ZipCode])

However, this is returning #Error when previewing the report?
Any thoughts?
Go to the top of the page
 
niesz
post Dec 6 2007, 09:06 AM
Post#2


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


Get rid of the underscore at the end of the first line. Controls don't use line continuation characters.
Go to the top of the page
 
strive4peace
post Dec 6 2007, 09:09 AM
Post#3


strive4peace
Posts: 20,459
Joined: 10-January 04



Hi William,
ControlSource cannot have a line continuation -- put everything on one line

you might want to just put that equation into the RecordSource instead of making it a calculated control
Go to the top of the page
 
dashiellx2000
post Dec 6 2007, 09:34 AM
Post#4


UtterAccess VIP
Posts: 9,829
Joined: 11-March 05
From: Maryland


The underscore isn't in my actual control source, I just put it there for posting as I didn't want to have to scroll all the way to the right to read the full code. Moving it to the query worked, but shouldn't this have worked in the Report itself?
Go to the top of the page
 
niesz
post Dec 6 2007, 09:35 AM
Post#5


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


Yes, provided that their are no controls named as these fieldnames.
Go to the top of the page
 
strive4peace
post Dec 6 2007, 09:36 AM
Post#6


strive4peace
Posts: 20,459
Joined: 10-January 04



Hi William,
shouldn't this have worked in the Report itself? "
sometimes, not always -- it is better to put calculations like this in the RecordSource
Go to the top of the page
 
strive4peace
post Dec 6 2007, 09:38 AM
Post#7


strive4peace
Posts: 20,459
Joined: 10-January 04



Hi Walter,

oh, so that's it? Thanks again wink.gif

Ocan't remember the circumstances under which I have seen this not work -- now I just never put this kind of stuff into controls, I always use the RecordSource ...

Edited by: strive4peace2007 on Thu Dec 6 9:38:45 EST 2007.
Go to the top of the page
 
niesz
post Dec 6 2007, 09:48 AM
Post#8


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


Yeah, that's why a lot of people just prefix all of their report controls with 'txtXXX' or 'ctlXXX', etc. You'll run into the same issue when you try to sum a control name that is the name of a field, too. I think Ricky had a recent post (within the last couple of days) that had the same problem.

Ricky's thread
Edited by: niesz on Thu Dec 6 9:51:49 EST 2007.
Go to the top of the page
 
strive4peace
post Dec 6 2007, 09:53 AM
Post#9


strive4peace
Posts: 20,459
Joined: 10-January 04



Hi Walter,
only Name controls the same as a field when the ControlSource is bound ... but it seems that sometimes the field has to actually be ON the form to be used in an equation.
A few months back, I helped someone with a report that had a LOT of calculated controls and it would get all kinds of errors at odd times -- we moved everything to the RecordSource and then it was just fine. The controls were all named things like Text67 and Text598 wink.gif
Go to the top of the page
 
niesz
post Dec 6 2007, 10:00 AM
Post#10


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


Really, that's my preference, as well. What goes on 'under the hood' of a report has always been a bit of a 'black box' to me, and I get nervous when I can't follow a process through 100%.
Go to the top of the page
 
dashiellx2000
post Dec 6 2007, 10:10 AM
Post#11


UtterAccess VIP
Posts: 9,829
Joined: 11-March 05
From: Maryland


Walter/Crystal,
Thanks for the help and the info. I still can't figure out why is didn't work on the report, the control is txtAddressInfo so that shouldn't be an issue
Thanks again.
Go to the top of the page
 
niesz
post Dec 6 2007, 10:12 AM
Post#12


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((°>


If you'd like to post a sample, I can take a look. Are there any other controls named as the names of any of the fields in the control source?
Go to the top of the page
 
strive4peace
post Dec 6 2007, 10:16 AM
Post#13


strive4peace
Posts: 20,459
Joined: 10-January 04



and does the code compile?
.. I have seen this not work, William -- and I am very conscientious about checking control names... sometimes, things just get too complex ... and the RecordSource is more efficient -- how much memory is in the machine?
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    21st September 2019 - 09:20 PM