M
Marla
Hi all. I have a situation I could use some help with. I have a
database used for a high-volume electronics repair business, and I'm
trying to streamline pre-shipment paperwork functions for customer
service. Depending on the customer and order type, up to 6 different
reports might be printed for each order.
I've set up a table populated on an ad hoc basis by customer service
through a continuous form with a text box for the order identification
number and a check box for each report to select which to print. Each
of these reports might also be printed from elsewhere in the database
(while this table contains no records, as it's emptied when this form
is closed), so setting the RecordSource for the report to a query
linking this table to the current underlying RecordSource doesn't seem
a viable option.
I've tried a For ... Next loop to build criteria for each report, but
the results are inconsistent (selected reports may not open or may not
have results sets matching the user's request). It seems like a more
efficient way to pull exactly the right results would be to use an SQL
statement to pull the order numbers from this table where the option
for this report = True and pass it through the where condition of the
OpenReport command, but I'm drawing a blank on just how to do this.
A sample SQL statement for selecting one type of report for printing:
SELECT tblWorkOrderPrint.lngWorkOrderNum,
tblWorkOrderPrint.rptPackingSlip
FROM tblWorkOrderPrint
WHERE (((tblWorkOrderPrint.rptPackingSlip)=True));
Any and all suggestions are welcome. Thanks for your time.
database used for a high-volume electronics repair business, and I'm
trying to streamline pre-shipment paperwork functions for customer
service. Depending on the customer and order type, up to 6 different
reports might be printed for each order.
I've set up a table populated on an ad hoc basis by customer service
through a continuous form with a text box for the order identification
number and a check box for each report to select which to print. Each
of these reports might also be printed from elsewhere in the database
(while this table contains no records, as it's emptied when this form
is closed), so setting the RecordSource for the report to a query
linking this table to the current underlying RecordSource doesn't seem
a viable option.
I've tried a For ... Next loop to build criteria for each report, but
the results are inconsistent (selected reports may not open or may not
have results sets matching the user's request). It seems like a more
efficient way to pull exactly the right results would be to use an SQL
statement to pull the order numbers from this table where the option
for this report = True and pass it through the where condition of the
OpenReport command, but I'm drawing a blank on just how to do this.
A sample SQL statement for selecting one type of report for printing:
SELECT tblWorkOrderPrint.lngWorkOrderNum,
tblWorkOrderPrint.rptPackingSlip
FROM tblWorkOrderPrint
WHERE (((tblWorkOrderPrint.rptPackingSlip)=True));
Any and all suggestions are welcome. Thanks for your time.