Results 1 to 8 of 8
  1. #1
    ChelseaC is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3

    Update Existing Access Tables with Data from Excel

    I am trying to determine a way to update multiple tables in Access from a single spreadsheet in Excel. I need to be able to change data in an existing record based on the Excel spreadsheet (only if something is different) and add new records if there isn't a matching record between Access and Excel.



    The Excel file is set up so each project has many many columns of information. The information in certain columns needs to go to fields in certain tables.

    What would be the recommendation in this situation? Are there any references to this sort of thing?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Lots of code.

    Lots of references. Approach depends on structure of the spreadsheet.

    Options involve:

    1. set link to Excel sheet. Treat the link as a table (except cannot edit data). Use it as source for queries (SELECT, UPDATE, INSERT)

    2. open the Excel sheet as an object in VBA and manipulate the object to pull in data and analyze and do what you want with it - update existing records or add new records
    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
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    Your success depends on your level of expertise. Judging from your question, I'd say you have a rather steep learning curve IMO. I'd start by linking the Excel worksheets in Access. Access will treat the link as a table. Next, I would look at queries, especially if you do not have a working knowledge of VBA. The query learning curve is faster, but still involved. Hope this helps a little.

  4. #4
    ChelseaC is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3
    The challenge I face with trying to link the Excel file (because that was my first idea) is that the Excel file will not always be the same. I just can't guarantee that it will be able to work that way. I have used VBA in Excel quite a bit, but have very limited knowledge of using VBA in Access. It's different and I just haven't been finding a good resource to learn from.

    How would queries be used in this situation? Is there a guide or resource of this being shown?
    Thank you!

  5. #5
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    The Excel file "will not always be the same": is that because the data will change or the structure. If structure, what kind of structural changes. For instance, Excel column headers are typically used as field names in Access, so efficient db engineering dictates those don't change. Although they can move in the workbook, ie shift columns, column header names should remain static.

  6. #6
    ChelseaC is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    3
    I understand that. The data will definitely change. However, I can't guarantee that the headers in the Excel file will remain exactly the same. It would make sense for them to remain the same and for the most part they will, but I have to hand control of this database over to a a different group of people in a few weeks and it needs to be as dummy proof as possible. I think I can deal with headers not being exactly the same, but I don't know how to work with data in Access.
    The point of my original post was to see if there was a method out there that could be used to update info that's in multiple tables in Access from a single worksheet in Excel. However, that doesn't seem to be the case, so I need to write all of the VBA code to accomplish what I need. I know I can do the Excel side of things, but I am not confident with the Access side of things. Do you have a solid reference for VBA in Access?

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Lack of consistency in Excel structure makes this very difficult to impossible. If you don't know the Excel column names in advance, how will you be able to programmatically 'map' to the appropriate fields in Access table? Really need to coordinate with editors of the Excel sheet and settle on a fixed structure.
    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.

  8. #8
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    No way can VBA skills be developed in a "few weeks". Probly best bet is guru.com or hire somebody here. sorry.

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

Similar Threads

  1. Data update Access to Excel
    By b82726272 in forum Programming
    Replies: 3
    Last Post: 06-19-2014, 09:06 AM
  2. Import Excel data into existing Access Table
    By octsim in forum Import/Export Data
    Replies: 4
    Last Post: 10-24-2013, 07:21 AM
  3. Replies: 4
    Last Post: 11-21-2012, 03:17 PM
  4. Importing Excel Data Tables into Access
    By Itch in forum Programming
    Replies: 5
    Last Post: 09-08-2012, 11:27 AM
  5. Replies: 3
    Last Post: 02-13-2012, 12:20 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