Results 1 to 8 of 8
  1. #1
    th1nker is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Aug 2013
    Posts
    5

    Linking one linked table to another

    I have two linked tables in Access. The first table is linked to an excel spreadsheet which we require to input data. This is because one of our machine vendors insists upon using excel to store data. The second linked table is in our MySQL database. Both linked tables work exactly as intended. The excel one sees any changes made on excel, and the MySQL one sees all the entries in MySQL, and is able to modify, and add entries. What I want to do from here is to select any records which are added to the excel file, and insert them into MySQL.

    To clarify what I want to do, here is an example: Machine A is constantly logging state changes and errors to an excel spreadsheet. All of these records appear on the linked table in MS Access. All of these records need to be inserted into the MySQL linked table in Access so that they appear on the database.



    Is there an easy way to do this, or do I have to write a query/vba script? I am comfortable doing both.
    Any advice is welcome!

    Thanks in advance for your time =)

    Additional info:

    I need this process to be automated, and cannot manually export and import files. I welcome suggestions to do it another way, but the most likely case is that I will use Excel -> Access -> MySQL. I cannot change the data source; it will remain an excel spreadsheet.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Will have to use INSERT and/or UPDATE sql actions which can be executed through VBA code in some event such as form Open or button Click.
    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
    th1nker is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Aug 2013
    Posts
    5
    Ah, that's what I thought. Clicking a button every time you want to update/insert might get tedious, so is it possible to use a row insert (new record added) as an event? This way, whenever the excel linked table is updated, it triggers an insert/update statement?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Row insert event code in Excel? Not that I am aware of.
    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.

  5. #5
    th1nker is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Aug 2013
    Posts
    5
    Sorry, I was thinking row insert event code in access (the linked table for excel).

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Can't edit Excel file from Access. AFAIK, the linked worksheet has no events.
    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.

  7. #7
    th1nker is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Aug 2013
    Posts
    5
    I appreciate the help!

    Edit:
    I am working on a solution to my inquiry and will be posting it as soon as I resolve it. I expect it to be resolved later today or early tomorrow.

  8. #8
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    313
    Could you use the timer event? Every so often (1 minute, 15 minutes, etc.) count the rows. If the row count is higher than the previous row count, copy the new rows from Excel to MySQL.

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

Similar Threads

  1. Replies: 6
    Last Post: 05-16-2012, 12:43 PM
  2. Replies: 3
    Last Post: 12-06-2011, 11:32 AM
  3. Replies: 0
    Last Post: 11-30-2010, 12:23 PM
  4. Replies: 3
    Last Post: 01-21-2010, 08:10 PM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 AM

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