Results 1 to 7 of 7
  1. #1
    chewbears is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21

    Mapping Fields

    I have 2 tables with different fields. The fields as an example are as follows.



    Table 1

    Name
    Address
    Phone

    Table 2

    Person
    Location
    Cell

    I would like to merge the tables by mapping the fields.

    How can this be accomplished. I know that if I wanted to export them. I could have an Export SQL expression to do this, but how can I maintain it in access?

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    You could merge the two tables with a Union Query.
    Code:
    Select *
    From Table1
     
    Union
     
    Select *
    From Table 2
    This will work so long as there are the same number of fields in each table.

  3. #3
    chewbears is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21
    Thank you for the response, but while my generic example may over simplify things, the tables are very different. They hold from 30-75 fields, and in all cases will never have the exact number of fields, or always have a corresponding fields.

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    A union query is still doable but will require a little bit of preparation. For those tables that don't have a corresponding field, type in a new field in the same location (on the QBE grid) the name of the correponding field in the table that does have a field followed by a colon and 2 double quotation marks. ie. (NewField: ""). Do this for all the fields. Save the query as a select query. for the other table create a select query for all fields. Save it.

    Open a new query. Open it in SQL format. Open the select queries in SQL. Copy the SQL statements from each of the select queries and paste it to the new query. Insert the Union between the two SQL statements.

    Good Luck.

  5. #5
    chewbears is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21
    Is there then no template mapping for fields you can do in Access? I am very surprised, as I know for previous versions, there were quite a few field mapping 3rd party softwares developed. Will go ahead with your suggestion, but ultimately I can do this method when exporting to excel, so it really is another version of an existing solution. Will tell you how it goes. Additionally this forces me to always have order in the fields position otherwise they will just merge consecutively. I would much rather be able to say (in code) Field1 = FieldOne on in the real work Closed_ticket = Status_none

  6. #6
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    I am not aware of a mapping procedure in Access. Perhaps you could try using an Append query.

    http://office.microsoft.com/en-us/ac...010076526.aspx

    Alan

  7. #7
    chewbears is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21
    thanks for the tip. Will check the excel forums to see if they know anything : P. Otherwise I will just keep things as they are.

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

Similar Threads

  1. mapping from excel to access
    By christian09 in forum Import/Export Data
    Replies: 4
    Last Post: 10-20-2011, 10:31 AM
  2. Visual Mapping Using Zip Codes?
    By kalisti in forum Reports
    Replies: 1
    Last Post: 01-03-2011, 07:26 PM
  3. Importing and mapping data to various tables
    By rasticle in forum Import/Export Data
    Replies: 1
    Last Post: 05-17-2010, 04:22 PM
  4. mapping problem?
    By stevenyp in forum Programming
    Replies: 2
    Last Post: 10-08-2009, 10:13 AM
  5. form - subform field mapping
    By nqirar in forum Programming
    Replies: 2
    Last Post: 03-02-2009, 01:49 PM

Tags for this Thread

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