Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24

    Smile How to copy Table2 columns in to Table1 ?

    Hi all,



    I have design table1, the table1 have 10 columns ex: slno, EMP_ID, EMP_Name, EMP_loc, EMP_designation, EMP_Status.

    I have imported an excel file(with formula acimport) have EMP_ID, EMP_Designation and some other date...after importing this excel in to access it will be coming in to table 2....If I use the DoCmd.CopyObject then table1 is replacing with table2 so I have lost table1...

    How to replace Table2 columns( Emp_ID and Emp_Designation) into Table1 columns of Emp_ID and EMP_Designation

    Emp_ID is in number format and Emp_Designation is in Text Format

    Regards,
    Sai

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    You want to add the Excel records to table1? Can you just import directly to table1?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    Yes I have imported Table2 records but in Table2 some records i want to copy Table1......So i have used a formula but it's now working.......Can you help me

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Why do you need to duplicate records from table2 to table1?

    An INSERT SELECT sql action might accomplish what you want.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    Everyday we are getting Table2 from my boss, then we have enter table2 some field into table1 and depend upon those fields we have to enter remaining fields in table1........so if i copy automatically the table2 required fields then my job Easy.......Can you give me an example formula?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Review http://msdn.microsoft.com/en-us/libr...=sql.105).aspx

    Must be a language barrier. I still don't understand why you don't just import from Excel directly to table1 and then complete data entry for the remaining fields.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    OK I will give an example: Table1 have these fields slno, EMP_ID, EMP_Name, EMP_loc, EMP_designation, EMP_Status............OK
    Table2 have these fields EMP_ID and EMP_designation............only....OK

    I don't know how to import only EMP_ID and EMP_Designation into Table1............Can you give me formula.....i really appreciate.......

  8. #8
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    What problem do you face when you try to do what June has suggested ( i.e. import from the excel sheet )?
    Perhaps, you can use the "External Data" & use the append data option.

    Thanks

  9. #9
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    Importing external ms-excel data file with formula(given command button to import excel) but i don't want all fields which i have been importing file

    My problem is importing excel sheet have a lot of unnessary data, i want first and middle columns only ..........I don't know how to copy those columns in to my table............Is it clear.......appolized for my confused statement

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Import wizard allows you to selectively import columns. Should be able to create an import specification with the import wizard and then call that specification whenever needed. Review
    http://office.microsoft.com/en-us/ac...001226307.aspx
    http://office.microsoft.com/en-us/ac...010171498.aspx
    Last edited by June7; 10-08-2012 at 10:53 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    I want formula........i am not importing files from outside......I want formula for how to copy existing table data to another table.......

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    My understanding is that you are importing from an Excel spreadsheet into table2 then you want to copy data from table2 into table1.

    I am still confused about why you don't just import directly to table1.

    Otherwise, I gave you a link in post6 for guidance on doing an INSERT SELECT sql action that can be used to copy data from one table to another.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    I am using access forms and I have coperating Table1 with full commands, I have given commands like field1 depends field2 result will come...........like that. So if i am importing table2 as table1 it's completely replaceing with my table1.....i am using command acimport when importing data..........can you give me a formula for without disturbing my
    Table1.........Thank you for your response...

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    I don't have a 'forumula'. I referred you to a tutorial on sql INSERT SELECT action.

    I am not suggesting you import the spreadsheet to replace table1, you can append records to table1.

    You have been referred to resources to accomplish what you want. Attempt code and post it for analysis if it errors.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    INSERT INTO Table1 ( [ICN NUMBER], [Edit No] )
    SELECT [Audit Claims].ICN, [Audit Claims].COD
    FROM [Audit Claims] INNER JOIN Table1 ON ([Audit Claims].COD = Table1.[Edit No]) AND ([Audit Claims].ICN = Table1.[ICN NUMBER]); throught query wizard but it's not appending any records to table1...............Please help me....

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 07-08-2012, 02:20 PM
  2. Copy values from table1 to table2
    By wubbit in forum Queries
    Replies: 2
    Last Post: 04-19-2012, 04:40 PM
  3. Replies: 4
    Last Post: 08-04-2011, 02:57 PM
  4. Replies: 5
    Last Post: 08-20-2010, 06:40 AM
  5. Use Table1 to update Table2? Urg Help needed
    By munkifisht in forum Queries
    Replies: 1
    Last Post: 07-24-2009, 08:00 AM

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