Results 1 to 5 of 5
  1. #1
    Douglasrac is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    92

    Question How to update records in Access using data in excel

    Hi,




    I have a query in acess which brings data from different tables. Each month I print this query and I send to a person that will modify the numbers (manually - yes with a pen) and give it back to me. Then I update it manually (in the computer) and print it back to verify.


    Once I have the final version done, I have to put the updated data into access again. And this is the part I would like to automate (since its not possible to automate the first step because the other person is a retarded on computers and want to use a pen).


    So how can I import the data I updated in excel to access? As far as I saw I can only import data into a table, not update using a query. Plus while we are making this manual updates, the data in access is changing. So copy and paste is not an option since the order of the records in the query will be heavily different.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    When you export the data, add an extra field that has the table name
    or export each table to its own sheet tab in the workbook.

    Once the sheets are corrected, put the corrected workbook in the 'imported' folder. Where The workbook has already been linked.
    now you can run a macro that has all the update queries needed to update the tables from the linked workbook.

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    So how can I import the data I updated in excel to access? As far as I saw I can only import data into a table, not update using a query. Plus while we are making this manual updates, the data in access is changing. So copy and paste is not an option since the order of the records in the query will be heavily different.
    You can link to excel and run update queries but

    I have a query in acess which brings data from different tables.
    implies you need to update multiple tables which means you will need multiple update queries. Further, assuming you are updating an existing record, you will need in your excel table a uniqueID (typically a primary key autonumber) for each table you want to update.

  4. #4
    Douglasrac is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    92
    Well if I update only one table it would already help me a lot. I do have an unique ID. I just don't know the step on how to import this data in a way that will update existing records without creating a new table.

    The excel sheet have 100 records. Unique ID and Value to be updated.
    The access table have 1000 records with many other fields.

    How that would work step by step?

  5. #5
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    I'm assuming you don't mean 'Unique ID to be updated'

    1. create a linked table to excel (no need to import it)
    2. create an update query where you have your destination table linked to the excel linked table on your uniqueID which updates the appropriate fields in the destination table with the values from the linked table.
    3. run the query

    tips, so you don't have to keep relinking to the next excel file next week etc, give the excel file a generic name (e.g. ImportData.xlsx) when you first create your linked table

    then next week, you get your file back, keep a copy by all means, but copy and replace it to the same name and location as the excel file ready for importing- the linked table will then be looking at the new data.

    I liken it to a linked table being represented by a microscope and the excel files for import as a slide -slide one out, slide the next one in

    Try it

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

Similar Threads

  1. Replies: 4
    Last Post: 12-16-2014, 03:31 AM
  2. Importing Excel to Access > Objective: Update records
    By Douglasrac in forum Import/Export Data
    Replies: 6
    Last Post: 09-04-2014, 07:11 PM
  3. Data update Access to Excel
    By b82726272 in forum Programming
    Replies: 3
    Last Post: 06-19-2014, 09:06 AM
  4. Update records on only ONE FIELD from excel data?
    By stildawn in forum Import/Export Data
    Replies: 3
    Last Post: 11-19-2013, 04:55 PM
  5. Replies: 5
    Last Post: 03-13-2013, 02:11 PM

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