Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Merging Two Fields

    How do you merge two fields together can that be done?? I have a AccountNo field and a OwnerManagerID field one has numbers and the other as a Letter and I need to merge the fields so its 0001110000A is that possible?? Or do I have to do this manually by just typing it in

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    merge fields together INTO WHAT?
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    hI THREAD

    I wanted to merge two fields togehter into another field?? Lets say the field is called OwnerMgrAct?? is that possible??

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by desireemm
    I wanted to merge two fields togehter into another field?? Lets say the field is called OwnerMgrAct?? is that possible??
    It's possible ... But WHY? You have that info in their original columns ...
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Its someone elses database

    And the person who built it messed up, so instead of doing it manually can we merge the two fields together because thats the actualy customer number. Make it one field instead of it being two.

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by desireemm
    And the person who built it messed up, so instead of doing it manually can we merge the two fields together because thats the actualy customer number. Make it one field instead of it being two.
    That's not a reason:"Just because you can" ... What is the rational for doing this?

    I mean, you can do this with a simple UPDATE query ... Be aware tho of the ramifications ... Keys. Are you making this "new" column to be the PK of the table? What about related tables? Are these 2 columns a FK to other tables? Are there dependencies?
    Back to Access ... ADO is not the way to go for speed ...

  7. #7
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    No

    No theres no dependents or and its not a foreign key or primary key

  8. #8
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by desireemm
    No theres no dependents or and its not a foreign key or primary key
    Then why bother???? Any form or report you can devise can have that info concatentated and displayed with no discernable difference ...

    Are you doing this to clean up the table design?
    Back to Access ... ADO is not the way to go for speed ...

  9. #9
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    why bother

    it was a request, they requested that be done, they want it in a query for a report..they want it in the table that way

  10. #10
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by desireemm
    it was a request, they requested that be done, they want it in a query for a report..they want it in the table that way
    Ah ... Make an UPDATE query ...

    UPDATE WhatEver SET YourColumn=ColumnA+ColumnB;

    Then Execute it ... Make sure of your types and sizes ...
    Back to Access ... ADO is not the way to go for speed ...

  11. #11
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Quote Originally Posted by desireemm
    it was a request, they requested that be done, they want it in a query for a report..they want it in the table that way
    Who is "they" and why do the care what the underlying table structure is? Their query will look exactly how they ask if you use "field1 & field2 As TheirRequestedField"
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  12. #12
    Join Date
    May 2006
    Location
    Alabama
    Posts
    37
    I recommend placing the following code in the lost focus event of any field following the two fields in question, then it’s just a matter of scrolling through the records. I used a field named “testfield” in this example


    Private Sub testfield_lostfocus()

    On Error GoTo Err_testfield_lostfocus

    OwnerMgrAct.value = AccountNo.value & "" & OwnerManagerID


    Exit_testfield_lostfocus:
    Exit Sub

    Err_testfield_lostfocus:
    MsgBox Err.Description
    Resume Exit_testfield_lostfocus


    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •