Concatenate two fields (text & number) for key field

  • Thread starter Thread starter Larry Elfenbein
  • Start date Start date
L

Larry Elfenbein

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
 
No event, in the control source of the third field you can write

=[Field1] & [Field2]

Or, with seperator
=[Field1] & " " & [Field2]
 
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 & "'")
 
Back
Top