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!

Can I combine two table fields into one object on a form?

Status
Not open for further replies.

KerryL

Technical User
May 7, 2001
545
US
If I have a form whose record source is a table containing first and last names, can I create a text box on the form that contains both names?

For example:
Table = tblCusts; contains "LName" & "FName"

Form = frmCust; record source = tblCusts
frmCust contains a text box called txtName

Can I populate txtName with data from LName & FName by identifying its record source something like this:
="Last_name" & ", " & "First_name"

IOW, I'm trying to turn independent first and last name table fields into a single, full-name text box. I've done this sort of thing in queries, but can't seem to get it to work on a form.

TIA for any advice,
kerryl


 
You can create a query that concatenates two base table fields but you can't update the derived field. The issue is SQL cannot in general know which source field to propagate your update to.

Apart from that, your form will work if you use a query with a field txtName generated in the query, not on the form. Indeed avoid ever connecting programs directly to base tables. Always use a query as your view.

 
I got it to work with this as the control source:

=[First_name] & " " & [Last_name]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top