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 & "'")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top