ksng1760
07-04-2005, 09:10 AM
Hi there,
I hope any of you can help me with this prob.I have done up a sales invoice database and would like to use report to print direct sales invoice. However, the sales invoice report prints out all entries. Can anyone pls help? Thanks
WayneRyan
07-04-2005, 10:22 AM
ksng,
Put a Command Button on your form with this code in its OnClick event.
+----- Your report's name
| +--- Your table's primary key
| | +-- The field on your form
| | |
V V V
DoCmd.OpenReport "YourReport",,,"[InvoiceNumber] = " & Me.InvoiceNumber
If your primary key was a string:
DoCmd.OpenReport "YourReport",,,"[InvoiceNumber] = '" & Me.InvoiceNumber & "'"
If your primary key was a date:
DoCmd.OpenReport "YourReport",,,"[InvoiceNumber] = #" & Me.InvoiceNumber & "#"
Wayne
ksng1760
07-05-2005, 01:26 AM
Hi. Thanks for your help wayne but what I meant was to print an invoice report which shows only entries from a specific invoice number and not entries from the whole databse. Can u pls help? Thanks
adenwalker
07-05-2005, 02:45 AM
Have you tried creating a query and in the Invoice Number field enter [Enter Invoice Number] in the criteria.
Then base your report on the query.
When you run the query a box should popup. Enter an invoice number and you should get the inoive for that number only.
WayneRyan
07-05-2005, 12:19 PM
ksng,
My last post will print only the ONE invoice that is displayed on the form.
That's where the Me.InvoiceNumber comes in.
Wayne