Dear friends,
I wonder if may be somebody has an idea of how to write the VB code to do run an Access query using an Excel VB command button?
The goal is it, after I have finished working on my Excel table, that I can push a button on the Excel sheet which launch an saved Access query.
If I would do the job manualy I would need to open the Access DB , go to Queries and double click my Query.
Example:
I have an Excel DB (Table1.xls) with a Table "MyExcelData" on Sheet1
I have as well an Access DB (DB1.mdb)
- with the same table format "MyAccessData" as "MyExcelData"
- with a linked table to my "MyExcelData"
- with a Update Query "MyQuery" (updating selected changes from the linked "MyExcelData" to "MyAccessData"
Instead of double clicking on the "MyQuery" in Access, I like to only click on a button in Excel, without having to open or touch to Access DB.
I thank you for any tip of how to program correctly a sub like this
Private Sub CommandButton1_Click()
Execute."MyQuery".located in C:\my Documents\ DB1.mdb
End Sub
Jerry
In Access I created an Update Query (MyQuery) which updates any changes
I wonder if may be somebody has an idea of how to write the VB code to do run an Access query using an Excel VB command button?
The goal is it, after I have finished working on my Excel table, that I can push a button on the Excel sheet which launch an saved Access query.
If I would do the job manualy I would need to open the Access DB , go to Queries and double click my Query.
Example:
I have an Excel DB (Table1.xls) with a Table "MyExcelData" on Sheet1
I have as well an Access DB (DB1.mdb)
- with the same table format "MyAccessData" as "MyExcelData"
- with a linked table to my "MyExcelData"
- with a Update Query "MyQuery" (updating selected changes from the linked "MyExcelData" to "MyAccessData"
Instead of double clicking on the "MyQuery" in Access, I like to only click on a button in Excel, without having to open or touch to Access DB.
I thank you for any tip of how to program correctly a sub like this
Private Sub CommandButton1_Click()
Execute."MyQuery".located in C:\my Documents\ DB1.mdb
End Sub
Jerry
In Access I created an Update Query (MyQuery) which updates any changes
Last edited: