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

Text Box... Adding multiple Values?

Status
Not open for further replies.

cranebill

IS-IT--Management
Jan 4, 2002
1,113
US
I have a text box on a report that i want to have 2 values in. The Report is based on a query. I want to have a first name and a last name in one text box instead of two, is this possible. In Control Source i have the following formula:

=[FirstName]&[LastName]

of course it didnt work... any other suggestions?

Bill
 
Hi Bill!

I don't know if it is just a typo or not, but you need spaces before and after the ampersand.

hth
Jeff Bridgham
bridgham@purdue.edu
 
In order to do what you want you must have two additional controls on the report. Both should be hidden, since you don't want them printed. One should be txtFirstName and contain the value of FirstName, the other should be txtLastName and contain the value of LastName.

The formula will then be something like this:
me.txtFirstName & " " & me.txtLastName

This is also true for any value you want to get from the underlying source table and use for computing. You must put the value into a control on the table (or form) and then reference the control, since you can't reference the value in the row of the table directly.
 
Hi BSMan!

Actually, as long as the field is part of the recordsource of the form, you can reference it directly as Bill was attempting.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Well i have tried both ways and both didnt work for me lol ill put what i used...

=[FirstName] & " " & [LastName]

This produced an #error

=me.text42 & " " & me.text43

this required me to define me and then gave me a ?name error

Bill
 
I took off the = sign and it works fine lol go figure lol

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top