Print command

aligahk06

New member
Local time
Today, 21:40
Joined
Apr 30, 2010
Messages
8
Dear experts,

I've a form with upto 2000 records.
Each record is associated with unique invoice nO.I want a print command in my form so that if i click the print command
then it prints the selected records say the record no is 2 of 5. it only prints record no 2 only.
i.e for a single click only one record should be printed.
 
Create a query that includes the invoice number and all other data that you would like to appear on the invoice and make reference to the
text box on the form that is bound to the invoice number in the table.

For example: Forms![YourFormName]![YourTextBoxName]

This goes in the criteria row of the query. Base the report on this query.

Alternatively, you coul pass a WHERE clause to the report in the code under the command button.

For example : DoCmd.OpenReport "ReportName", acViewNormal, , "[InvoiceNumber] = Forms![YourFormName]![YourTextBoxName]"

where Me.txtInvoiceNumber is the text box on the form that is bound to the invoice number in the table.


 

Users who are viewing this thread

Back
Top Bottom