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

Simple join of tw fields 1

Status
Not open for further replies.

Griff389

Technical User
Jun 27, 2003
82
GB
In my form i've got a control which simply joins two name fields together to display the full name. The code I have is:

Code:
=[First Name]+" "+[Surname]

This works fine in the form, but when I try it in the report (with the same fields), it comes back with #error.

I've tried changing the + for &, with the same results. Any ideas how to get it working.

Regards

Griff
 
what are you bounding your report to?

if your report is bound to a query, then you need to use the name of the fields you used in your query, and if it's bound to a table, then you would need to use the name of the fields as in the table...

the error simply says that it doesn't recognise those 2 names you've given, i.e. whatever source you've bound your report to doesn't contain either [first name] or [surname]

--------------------
Procrastinate Now!
 
Griff389
#error generally occurs because of dragging one of the fields into the report design and then trying to add to it.

Try putting an unbound control on your report design. Then make its control source
=[First Name] & " " & [Last Name]

Tom
 
Thanks Guys,

It was bound to a query, and the names were the same as the query fields.

I tried the unbound control first, then added =[First Name] & " " & [Surname] and it worked.

You know what it's like when you are sure you have tried something, but when you do it again it works. This was the same.

Thanks again guys.
 
as a side question, does anyone know how to edit a previous post. For example I wanted to correct the spelling mistake in the subject line, but can't for the life of me find an "Edit" button/link anywhere. Surely there's a way.
 
Griff389
I don't think you can "edit" a previous post. Once it's posted, it's posted. I believe they're all stored as text files.

You can ask to have the entire post removed, by flagging it as an inappropriate post.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top