Results 1 to 4 of 4
  1. #1
    oddish is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    2

    Excel data into 2 different tables, going into Access.


    solved- thank you june7
    Last edited by oddish; 02-13-2012 at 12:00 PM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The table doesn't have date or customer, I assume those are the two columns you deleted. The 'many' records need to be rearranged like this (example is sorted by OrderID):

    Code:
    OrderID | Quantity | Product
    1 | 1 | B&BDOUGF
    1 | 25 | CUTDOUGF35
    1 | 1 | HOW4HONDGENG
    ...etc
    I suggest the quickest method for this number of records is copy/paste. Copy and paste each ProductID and Quantity column pair below the first pair. Also copy the OrderID column with each pair. Do a sort to make rows with blank Product/Quantity list at the end and delete those rows (or don't and delete after the import). Then import to OrderDetails table.

    A side note: It is possible to select spreadsheet cells and then copy/paste to Access table. A little tricky but doable. The reverse is also possible and even easier.

    You might want to verify that the Autonumber id generated for the Orders records coincide with the original ID numbers in the spreadsheet
    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
    oddish is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    2
    thanks for your response, but in my opinion that would take forever with the copy and paste method. Because there is about over 1k entries, but yes you had the right idea.

    I've experimented a bit last night, and I've come to the conclusion that making a macro to organize the data to the structure of your example table would have been the best solution:

    https://sites.google.com/a/madrocket...ows-to-columns

    The macro(s) there are the ones that best fit my solution if anyone is wondering.

    So this thread can be closed, thanks for your response.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    My intended suggestion was to copy/paste whole columns. 1000 rows for each of the 9 column pairs is not much. Would have taken 10 minutes, less time than building a macro from scratch or in your case, less time than searching for a macro. My example was showing rows sorted after the columns copy/pasted. But the macro was a good exercise in using code so congratulations on finding solution.

    Really should not edit original post to remove question. It can make the following posts difficult to understand for other readers exploring a similar issue.
    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.

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

Similar Threads

  1. Import Excel Data to Multiple Access Tables
    By colby in forum Import/Export Data
    Replies: 3
    Last Post: 11-04-2011, 12:17 PM
  2. Prevent Excel opening Access Tables
    By Bishop426 in forum Security
    Replies: 4
    Last Post: 09-05-2011, 09:32 AM
  3. Replies: 1
    Last Post: 08-22-2011, 02:09 PM
  4. Access Tables Open in Excel
    By MikeDBMan in forum Forms
    Replies: 0
    Last Post: 03-31-2011, 02:43 PM
  5. Pivot tables and charts - Access or Excel
    By kkrishna in forum Access
    Replies: 1
    Last Post: 06-06-2010, 04:52 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