Link to home
Start Free TrialLog in
Avatar of Gary Croxford
Gary CroxfordFlag for United Kingdom of Great Britain and Northern Ireland

asked on

MS Access VBA to Update Linked Tables

Thank you for looking at my question,

I am putting a form together in an Access 2013 database that will enable user(s) to open report(s) via button click.

The tables/queries behind the reports are linked tables from Excel spreadsheets.

I would like the button click to refresh the relevant linked table(s) before opening the report to ensure that the data in the report is current.

How do I do this please using VBA?
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have never had to do this.  When you open the linked spreadsheet, Access retrieves the data so it is already "fresh".  Are you talking about making the spreadsheet run its calculations?  In that case, you would need to automate Excel.  So you would have Access use VBA to open excel and run the function to recalculate the spreadsheet.  Sorry, I don't have code handy.  Since I work with Access rather than Excel, when I need to do some Excel automation, I open Excel and turn on the macro recorder.  Then I try to perform the task I need to automate.  I then copy the code generated by the macro recorder and fix up the references so it will run in Access.
Avatar of Gary Croxford

ASKER

Thank You Dale