Query Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an inventory type database set up, and for one of the reports /
queries, as part of it, there is a "parts check out by work order table, and
I want to make a report for this, but by specific work order. I want it to
ask if possible ( with a dialog box etc ) for a work order number, then run
the report and totals for that work order.

Right now it runs totals for all parts used on all work orders in the table
in a query / report. How do I add in a choice for the user to type what
work order they want a report on?

Thanks,

Cat
 
Use a field on a form and refer to that field in your query criteria. For
instance, create a form for a report menu. Put an unbound field on that form
called WorkOrder. In your query, on the criteria line under the work order
number, use the expression builder to refer to your form/field:
Forms!frmReportMenu!WorkOrder

Then you can also put a button on the report menu to run your report. If
you need a range of numbers, use two fields and have your criteria:
Between Forms!frmReportMenu!BegWorkOrder and Forms!frmReportMenu!EndWorkOrder
 
Hi

A good trick is to put a combo on the form (call it print_some_report) and
use the AfterUpdate of the combo to print the report. You need to sort out
the control and field and names - basically you need to ensure the work order
number is on the report and that the combo is bound to a field containing the
work number (it needs to be bound in case you add other work orders - if you
don't you need to recode each time you add another work number)

DoCmd.OpenReport "ReportName", acViewNormal, "",
"[WorkOrder]=[Forms]![FormName]![print_some_report]", acNormal

Oh yes, of course there are other methods of fil;tering a report but this
way seems to have the less "mess-up" capabilites by users :o)

Hope this helps
 
Back
Top