Help picking macro actions

AtLarge

Registered User.
Local time
Today, 05:12
Joined
Oct 15, 2008
Messages
70
I have a very small db that has a very limited purpose to be ran by users with even less Access experience than me. If that is possible. :D

So, I want to:
(1) write a macro that will run when the db is opened.
One table is a network connection.
One table is on the C:\ drive of the user.

(2) Run one query. (One table, one joined query, one right join query)
Here is the SQL if it matters:
SELECT DISTINCT tbl_Source_BOM.[Material Number], tbl_Source_BOM.[Material Description], qry_Find_6_Component_Types.[VALUE DESC], tbl_Source_BOM.XMS
FROM (tbl_Source_BOM INNER JOIN qry_Find_6_Component_Types ON tbl_Source_BOM.[Material Number] = qry_Find_6_Component_Types.[PART NUMBER]) LEFT JOIN qry_Find_Single_Source ON qry_Find_6_Component_Types.[PART NUMBER] = qry_Find_Single_Source.[PART NUMBER]
GROUP BY tbl_Source_BOM.[Material Number], tbl_Source_BOM.[Material Description], qry_Find_6_Component_Types.[VALUE DESC], tbl_Source_BOM.XMS;

(3) Print the output to the default printer. It is only four columns so all should fit on default settings.

(4) Close the db and Access.

I want to make everything happen in the background but I cannot finish it so I need help picking my commands.

I started with OpenQuery and called the query name in the arguments.

I don't know how to tell it to update the tables. Is this necessary or will it do it on it's own when ran?

I tried to add the PrintOut action next. It's in the Help but not in my drop down list for macro creation? Found the OutputTo but the arguments don't seem to fit to printing.

I was just recently upgraded from 2003 to 2007 and there is quite a bit different so I am kinda lost.

Any suggestions? TIA.
 
Personally I would create a report based on your query and print that. You'll have more control over the look. You don't need to update anything unless you need to change the data. Running the report/query will retrieve current data. Presuming you go the report route, the macro action is OpenReport.
 
Yep, that was the best way to go about it. Once I had everything in place I just created an AutoExec macro to call the report as hidden, print and exit with save all. Works good with no interaction. Thanks!
 

Users who are viewing this thread

Back
Top Bottom