Updating excel worksheet from access query
Tip: Take a look at the Transfer Spreadsheet method of the Do Cmd object and use ac Spreadsheet Type Excel12Xml.
This procedure will create a button that you can push in order to automate the update process with a macro.
For example, if your Access table is linked to Excel spreadsheet, you cannot update any data in the spreadsheet from Access.
Suppose we have created a table called employee_tbl, now we want to update David’s salary to 11000.
Help users increase productivity by automatically signing up for Tech Republic's free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.
Unfortunately if you want to run any code when this refreshes, there’s no native way to do this.
”, vb Yes No) = vb No Then Cancel = True End Sub[/sourcecode] Your code should now look like the following: Right-click your project in the PE and select Insert Module. Add cls Q Next QT Next WS End Sub[/sourcecode] To initialize this code when the workbook opens, double click This Workbook module and use the following workbook open code: [sourcecode language=”vb”]Option Explicit Private Sub Workbook_Open() Call Initialize Queries End Sub[/sourcecode] That’s it, you now have query before/after events you can tie into.