PDA

View Full Version : Solved: Printing a report from VBA



ukdane
01-14-2010, 04:52 AM
Any idea how I can print a report, that is based on SQL created (with variables) in VBA?

I have the SQL as a regular query, BUT I need it to filter something before printing. I decided to use VBA so that I could assign the criteria as a variable, but maybe I should approach it differently.

Any ideas?

CreganTur
01-14-2010, 05:58 AM
Any idea how I can print a report, that is based on SQL created (with variables) in VBA?
If you're talking about a standard Report object, then you can use DoCmd.OpenReport- the default setting is to print to the default printer.

ukdane
01-14-2010, 07:28 AM
I wasn't, but thanks anyway. I found the result on another webpage.
Here: http://www.fontstuff.com/access/acctut19.htm