Concatenate two fields (text & number) for key field

Concatenate two fields (text & number) for key field

Post by larpup200 » Fri, 11 Nov 2005 18:45:27


I have a form. The first two fields need be concatenated into a thir
field for a Dlookup function later. My question is, where is the bes
event to place the concatenation function in? .(Lost focus of secon
field?) I am relatively new to this enviornment

Any assistance is appreciated

La
 
 
 

Concatenate two fields (text & number) for key field

Post by T2Zlc » Fri, 11 Nov 2005 19:13:01

No event, in the control source of the third field you can write

=[Field1] & [Field2]

Or, with seperator
=[Field1] & " " & [Field2]

 
 
 

Concatenate two fields (text & number) for key field

Post by S2xhdHV » Fri, 11 Nov 2005 22:23:04

If all you are going to use the concatenation for is a DLookup, I would
suggest you not create another control for that purpose alone. The best
place to do it would be just before you do the DLookup or in the DLookup
itself.

strSearchString = Me.txtFld1 & Me.txtFld2
DLookup("[SomeField]", "SomeTable", "[SomeField] = '" & strSearchString & "'"


DLookup("[SomeField]", "SomeTable", "[SomeField] = '" & Me.txtFld1 &
Me.txtFld2 & "'")