Results 1 to 4 of 4
  1. #1
    uaguy3005 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    45

    Importing Excel Data

    I have a database I use for tracking quality concerns. Currently data is captured in a corporate database and I export the data to excel and copy into my database. The data has many repeated values and when I import, I'd like to import into separate tables in my database. How would I go about doing that? Example data would be:



    ImportData
    Fields: Cell, Part Number, Failure Mode, Tag, Value, Shift

    tblScrap
    Fields: tblParts, tblSource, Failure Mode, Tag, Value, Shift

    tblParts
    Fields: Part Number, Value, tblSource

    tblSource
    Fields: Cell, Zone

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    if you are using different excel files to import to the various tables then,
    create an import macro that has
    all the transfer commands (similiar to those below, IMPORTEXPORTSPREADSHEET)
    or
    a button click and these vb commands:

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tblScrap", Filename1, True
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tblParts", Filename2, True
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tblSource", Filename3, True

    ---these will import the excel file to the tables

  3. #3
    uaguy3005 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    45
    The import data is all on one excel sheet in the same table. Just not sure what the process is to "explode" that table into the separate access tables.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    Then you need this method:
    Save the excel file to a generic name, say ImportFile.xls
    Attach (link) this file into access as a linked table, say: tblFile2Import (done just this once)
    Build queries needed to append the data from tblFile2Import to your target table, say: qaImportXLScrap

    Build a macro to run the monthly import. mImportXL
    The macro will have the quereries :
    qaImportXLSCRAP
    qaImportXLParts
    qaImportXLSource

    So every month/week,
    1. save your data to the generic file: ImportFile.xls (overwriting the previous one)
    2. Then run the import macro, mImportXL
    Done.

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

Similar Threads

  1. Importing data from Excel
    By ek77 in forum Import/Export Data
    Replies: 2
    Last Post: 05-13-2014, 12:33 PM
  2. Formstack & Importing Data via excel, best way to collect data?
    By Yogibear in forum Import/Export Data
    Replies: 2
    Last Post: 02-10-2014, 07:05 PM
  3. Importing Data from Excel
    By ineedaccesshelp in forum Import/Export Data
    Replies: 2
    Last Post: 11-28-2012, 11:02 PM
  4. Importing data from Excel
    By nik9 in forum Import/Export Data
    Replies: 2
    Last Post: 10-12-2012, 02:36 PM
  5. Importing data from Excel
    By dsaxena15 in forum Access
    Replies: 1
    Last Post: 10-03-2012, 10:56 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