Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Location
    los angles
    Posts
    2

    Concatenate two fields (text & number) for key field


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

    Any assistance is appreciated.

    Lar

  2. #2
    Ofer Guest

    RE: Concatenate two fields (text & number) for key field

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

    =[Field1] & [Field2]

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

  3. #3
    Klatuu Guest

    RE: Concatenate two fields (text & number) for key field

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

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-09-2008, 04:48 AM
  2. Split text field into two text fields
    By Grant in forum Access
    Replies: 6
    Last Post: 01-31-2008, 05:52 AM
  3. Quick way to stuff field names into text field
    By kfinpgh in forum Programming
    Replies: 0
    Last Post: 01-04-2007, 01:13 PM
  4. exporting text produces a number
    By greend in forum Import/Export Data
    Replies: 0
    Last Post: 07-12-2006, 03:55 PM
  5. Total Number of Fields allowed on a Form
    By tpearo in forum Forms
    Replies: 1
    Last Post: 12-15-2005, 06:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums