Macro in Access

billykiller05

New Member
Joined
Oct 17, 2007
Messages
23
I am new to access and I would like to write a macro to run a query. I receive a file each month so I need to be able to change the table for which the query is ran. I need some help getting started.
 
Last edited:
That works great. Thanks again. Is there a way to add the date I use to run my query to the filename each time so the spreadsheet would be TopAccounts 05-2008.xls or TopAccounts 04-2008 depending on the date used?

If you have this in code, you can:
Code:
...,"TopAccounts " & Format(Date(), "MM-YYYY") & ".xls",...

I am not sure if the same functoinality is available setting up as a through a macro, but you can try.

Does this actually open your queries to view (the openqurey command in your macro)? Because I want to create a series of macros to just run, I don't need to see them as they are make table and update queries.

Thanks,
Roger

Edit: Nevermind my question, I figured it out.
 
Last edited:
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,962
Latest member
Fenes

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