Report print Quantity in Access 2003

E

Ed

I'm have to prevent the print preview window from popping up during an
automated print. I just want the tiny print dialog box.
However,
DoCmd.OpenReport "Invoice", acNormal, , "[Order ID] = Forms![Orders]![Order
ID]"
Doesn't support Quantity. I have a quantity selector on my main form, 1, 2,
3, 4, Prev, with default = 2.

In Access 97 this app used:
DoCmd.OpenReport "Invoice", acPreview, , "[Order ID] = Forms![Orders]![Order
ID]"
DoCmd.PrintOut acPrintAll, , , , Forms![Orders].[PrinQuan]
But this displays a print preview.

Any suggestions appreciated
 
F

fredg

I'm have to prevent the print preview window from popping up during an
automated print. I just want the tiny print dialog box.
However,
DoCmd.OpenReport "Invoice", acNormal, , "[Order ID] = Forms![Orders]![Order
ID]"
Doesn't support Quantity. I have a quantity selector on my main form, 1, 2,
3, 4, Prev, with default = 2.

In Access 97 this app used:
DoCmd.OpenReport "Invoice", acPreview, , "[Order ID] = Forms![Orders]![Order
ID]"
DoCmd.PrintOut acPrintAll, , , , Forms![Orders].[PrinQuan]
But this displays a print preview.

Any suggestions appreciated

No need to open the report at all to print it.

DoCmd.SelectObject acReport, "Invoice", True
DoCmd.PrintOut acPrintAll, , , , forms!Orders![PrintQuan]

See VBA help on the SelectObject method.
 
E

Ed

Using your method results in printing all previous invoices in this
database(over 16,000), and the Actual Database window pops up when the
report is selected.

I think I need to somehow print the report based on my desired [OrderID].
Is Using the "DoCmd.PrintOut acPrintAll, , , , forms!Orders![PrintQuan]" my
only alternative?
Thanks


fredg said:
I'm have to prevent the print preview window from popping up during an
automated print. I just want the tiny print dialog box.
However,
DoCmd.OpenReport "Invoice", acNormal, , "[Order ID] = Forms![Orders]![Order
ID]"
Doesn't support Quantity. I have a quantity selector on my main form, 1, 2,
3, 4, Prev, with default = 2.

In Access 97 this app used:
DoCmd.OpenReport "Invoice", acPreview, , "[Order ID] = Forms![Orders]![Order
ID]"
DoCmd.PrintOut acPrintAll, , , , Forms![Orders].[PrinQuan]
But this displays a print preview.

Any suggestions appreciated

No need to open the report at all to print it.

DoCmd.SelectObject acReport, "Invoice", True
DoCmd.PrintOut acPrintAll, , , , forms!Orders![PrintQuan]

See VBA help on the SelectObject method.
 
Top