MS Access Query <==> MS Excel VBA

theodor

New Member
Joined
Jul 6, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Good evening Everybody,

I am using a microsoft access databse that consists of two split back end and front end, and my queries are located in the front end.
I have been searching on how to run one of these queries and import the outcome into excel sheet1!A5 for example, my main challenge here is that these queries are usually ran from another form, where some certain variables are already given upon opening the form, in other words, if I try to open the query directly without using the form, I will be asked to enter the variable value twice, which lets say is "ABC123" then the query will run according to that certain variable.
so in other words, the sequence as a user today goes like this:
Open database front end
click on form and select the customer "ABC123"
click on the query
copy the content of the query
paste in excel

my aim is to be able to type the "ABC123" in excel somewhere and get the VBA to do the rest, is that possible? if yes can someone help me getting a code for it? I am a beginner VBA user but any tips might help :)
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Forgot to add that the number of columns extractes varies from one customer to another :)
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,484
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top