Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Specific Invoice Numbers and no more!

Status
Not open for further replies.

jasonstewart

Programmer
Mar 14, 2002
39
US
I have several reports already designed and working printing all of the information from two tables. I don't want to make a new report just filter the one I am currently using by entering a date range and just having those print, or by entering an Invoice number range would work too. Is that possible? Thank you for any input. It sounds like it would be simple but I can't seem to figure it out. Thank you.
 
Hi

One way, base your reports on a query, create a form which allows the user to enter the parameters, and in the query, set the criteria to the controls on the form (using the builder) the syntax is similiar to Forms!MyForm!MyControl

By using the Like() option with * you can get all invoices, and for dates BETWEEN dateX AND dateY will do the trivk, to get all rows, you can set the dates (X and Y) to very early and very late values eg 01/01/1900 and 30/12/2999 Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
If you open the report from code you can set a 'Where' criteria

eg.

DoCmd.OpenReport &quot;Report1&quot;, acViewPreview, , &quot;(InvoiceNo > 1 AND InvoiceNo < 4)&quot;

this will open the report named 'Report1' in preview for records where Invoice number is greater than 1 and less than 4.

You can substitute the numbers for variables

eg.

DoCmd.OpenReport &quot;Report1&quot;, acViewPreview, , &quot;(Hit > &quot; & intInvoiceNoOne & &quot; AND Hit < &quot; & intInvoiceNoTwo & &quot;)&quot;

There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top