+ Reply to Thread
Results 1 to 2 of 2

VBA Code Within Excel to Update Access Database

  1. #1
    Registered User
    Join Date
    01-15-2018
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    11

    VBA Code Within Excel to Update Access Database

    Hello, I don't know what I'm doing. Great start.

    I am looking to update an access database from an excel spreadsheet. I want to link the fields by the first row in the excel spreadsheet (i.e. "EmployeeName", "Location", etc.). The spreadsheet itself has a different filename as we resave the master copy for each day, so we have "Closing Paperwork 1/26/18" for today and so on for the following days, so the code needs to be on Excel's side I assume. Is there a way to have the inputs in the excel table link to access as new fields? I want to prevent overwriting, if that's a thing that happens.

    One last request, I only want complete records to copy over, or only the rows that have all cells in the row that have data. It's a cash handling variance tracker, so if they have no variance I don't want their name/location in the Over/Short database. I hope that makes sense.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: VBA Code Within Excel to Update Access Database

    Upload sample workbook showing what record you want to push and what record not to.

    There are multiple ways of doing this. DAO, ADO, adding reference to Access application in the project and using Import etc, etc.

    Probably the fastest method is to use sql statement to [i]nsert into table.

    One such example below.
    https://stackoverflow.com/questions/...s-access-table

    However, generally speaking it's safer to read from closed workbook and from Access side.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Add or update an Access database record with data from Excel using VBA
    By bemidjipatriot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2017, 10:10 PM
  2. Using excel workbook to update access database on conditions
    By swade730 in forum Access Tables & Databases
    Replies: 5
    Last Post: 02-23-2016, 09:53 AM
  3. Update Access database from excel worksheet data through SQL in VBA Macro
    By anandagrawal444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2015, 07:06 AM
  4. Insert delete and update from excel userform to access database - help
    By rdm52 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2015, 09:45 AM
  5. Replies: 3
    Last Post: 05-30-2013, 04:29 AM
  6. Update/Delete a Record in an Access 2010 Database using Excel VBA
    By tomlancaster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2012, 12:36 PM
  7. Update Access database through changes in Excel worksheet
    By munkayboi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2007, 07:16 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1