Results 1 to 11 of 11
  1. #1
    Sonyat810 is offline Advanced Beginner
    Windows 7 64bit Office 365
    Join Date
    May 2022
    Posts
    37

    Can you add data to a linked excel table

    I have a linked table and a form. But I dont see where you can add data to the linked table
    Attached Files Attached Files

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Not directly as a linked table.
    However have a read here :
    https://www.access-programmers.co.uk...access.322079/
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    I tried the query and can't get past "Syntax error in FROM clause". And yes, I changed the file path and sheet name.
    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.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    can't get past "Syntax error in FROM clause".

    what is your sql?

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    Quote Originally Posted by Minty View Post
    Not directly as a linked table.
    However have a read here :
    https://www.access-programmers.co.uk...access.322079/
    As my post at AWF explains, you CAN directly edit a linked Excel table by changing the IMEX settings from the default IMEX=2 (read only) to IMEX=0 (editable)
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Query from tutorial with my sheet name and file path:
    Code:
    SELECT XL.*
    FROM (SELECT * FROM [Units$] AS xlData IN 'C:\Users\Owner\June\MyStuff\Condos.xlsx'
    [Excel 12.0;HDR=yes;IMEX=0;ACCDB=Yes]) AS XL;
    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
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    trying to determine which FROM is causing the issue as the syntax works fine for me - what if your try removing the alias? - and is Units the name of a worksheet or a range?

    SELECT * FROM [Units$] AS xlData IN 'C:\Users\Owner\June\MyStuff\Condos.xlsx'
    [Excel 12.0;HDR=yes;IMEX=0;ACCDB=Yes]

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    Quote Originally Posted by June7 View Post
    Query from tutorial with my sheet name and file path:
    Code:
    SELECT XL.*
    FROM (SELECT * FROM [Units$] AS xlData IN 'C:\Users\Owner\June\MyStuff\Condos.xlsx'
    [Excel 12.0;HDR=yes;IMEX=0;ACCDB=Yes]) AS XL;
    Whilst that code should work, the easier method is to link the Excel file as a linked table.
    If you do that, there is no need to run an external query

    Try using the example app included in the web version of my article: Edit Linked Excel Data from Access (isladogs.co.uk)
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,002
    Code:
    SELECT * FROM [Stock$] AS xlData IN 'F:\Users\Paul\Documents\Stock Quotes.xls'
    [Excel 12.0;HDR=yes;IMEX=0;ACCDB=Yes]
    
    
    SELECT XL.*
    FROM (SELECT * FROM [Stock$] AS xlData IN 'F:\Users\Paul\Documents\Stock Quotes.xls'
    [Excel 12.0;HDR=yes;IMEX=0;ACCDB=Yes]) AS XL;
    Either works for me.

    Thank you.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    Quote Originally Posted by Sonyat810 View Post
    I have a linked table and a form. But I dont see where you can add data to the linked table
    I have edited the connection string to make the linked Excel file editable in Access
    However, as you didn't supply the linked Excel file, I can't test whether that setting will 'stick' for you
    Attached Files Attached Files
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    VBA changing connection string of linked sheet did work.

    And crud. I deleted the worksheet link, copy/pasted my SQL from post 8 and tried the query again. Now it opens without error. Bizarre!
    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.

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

Similar Threads

  1. Replies: 3
    Last Post: 06-26-2020, 12:37 PM
  2. Replies: 2
    Last Post: 12-19-2016, 07:30 PM
  3. Replies: 3
    Last Post: 04-07-2016, 04:36 AM
  4. Replies: 9
    Last Post: 10-20-2014, 04:00 PM
  5. Replies: 5
    Last Post: 12-30-2011, 01:01 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