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!

#Error (Access 2007) field concatenation

Status
Not open for further replies.

epoh

IS-IT--Management
May 8, 2006
73
US
This is really simple, but I can't figure it out.

I am trying to concatenate to fields in an Access 2007 report.

Both are text fields (size 255)

This is what I have entered:

Code:
=[Field1] & " " & [Field2]

Every time I go to Print Preview it shows #Error

Update:
I can put [Field1] in an empty unassigned Text Box, but I cannot put [Field2] every time I do, it says #Error.

So obviously, the issue is with [Field2]. I can't delete it and start over because there is too much data in the table.

Any ideas, why I can't display this? I can display the field by itself if I drag it from the Existing Fields, but I cannot recreate this field.

Any advice would be appreciated.
 
You have told us quite a lot but didn't mention the name of your text box. Normally when you drag a field to your report, the text box created has the same name as the field. This causes an issue when you want to create any expression beginning with "=".

Try change the name of the text box to "txtBoth".

Duane
Hook'D on Access
MS Access MVP
 
[Field1] = Field1
[Field2] = Field2

I renamed the Field2 textbox to txt_Field2 and now it works if I make a new textbox called TextBox3 with the formula below:
Code:
=[txt_Field2]
Obviously this works with the textbox [txt_Field2] on the report, however if I remove the textbox txt_Field2 from the report and try to concatenate the two fields:
Code:
=([Field1] & “ “ & [Field2])
I get the same #Error
I can hide the [txt_Field2] textbox and concatenate the two fields and it works. But I would rather just concatenate the two fields for tidiness.

Thanks
 
Update: stranger still.

I can run the report with no errors if I don't acknowledge the security warning.

But if I run the report after I have enabled the content. I get the #Error in the same report.

Any help would be appreciated :(
 
Update: I created a new Trusted location and the issue appears to be resolved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top