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

Put 2 or more fields into 1 field 3

Status
Not open for further replies.

Lightlancer

Programmer
Jul 18, 2008
88
NL
Hi,

i have 3 fields, that must be put into 1 field,
so field 1 is: Test
Field 2 is: 12
Field 3 is: 3

Field 4 is the field wich contains all information, so when a user puts in data, VBA must automaticly put all 3 fields into 1 so that Field 4 is: "Test 12 3"

How can this be done, is thought:

Field 4 = "Field 1" & "Field 2" & "Field 3"

but that doesnt seem right
 
Gday again light,

Agree with PHV about storing but if you wanted use vba to display such data just lose the " which makes your field a literal string.

field 4=[field 1] & " " & [field 2] & " " & [field 3]

the " " is only used to concatenate a space between the values. Your code would make field 4 equate to a piece of text:

field 1field 2field 3

JB
 
What everyone is saying is no need to store a concatenated value, just use a query to display the concatenated value or do it directly in a form or report field.

in a query builder in a new column you would do it like

NewFieldName: [field 1] & " " & [field 2] & " " & [field 3]

on a form or report in the control source

= [txtBx1] & " " & [txtBx2] & " " & [txtBx3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top