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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cancatenation problem 1

Status
Not open for further replies.

hdgirl

Technical User
Feb 2, 2002
131
GB
I have converted a database from Access 97 to 2000 and have a report to print labels, one of the fields is called Name which is now an access reserved word, does anyone know how to get around this. this is what i am using at the moment

= Trim ([Title] & " " & [Initial] & " " & report![Name])
and i get back #Error

I've tried it without the report & this gives me Title, Initial & the report name.

Has anyone encountered this and can help me please?

CJB
 
Dim lcTempStr as String
lcTempStr = report![Name]

= Trim ([Title] & " " & [Initial] & " " & lcTempStr)
and i get back #Error

htewh

Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
I assume u have a report form. Another approach that may work is to create a text box on the report. Name the Text Box - TempStr (or something...) then set the data source of that test box to =[NAME]. Run the report to see if it appears ok. Then set to Visible property of TempStr to No. That way the TempStr field will not appear. But, we will reference it.

In the other field put
= Trim ([Title] & " " & [Initial] & " " & me.TempStr)

I think this is one approach that may help. good luck...


Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
Steve

I tried the first part and it all worked OK but when i changed the field to & me.TempStr it didn't like it at all, so i'll leave it without that line but can you tell me what it is that i have done......oh and thanks for your help



CJB
 
In this case, u have created a temporary field on the report form that can be referenced. Occassionally, it is easier to use this approach to carry variables that are needed on a form or subform. Making the field visible=false, esssentially makes the field not displayed, but can still be referenced by the form. In ur case, the reserved Field Name [Name], fails when contactonated. So, using a temporary field, with a different name, was the approach used to circumvent the Access limitation. good luck.

Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
Thanks Steve that explains it all thanks very mucj for your help

CJB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top