print a customer receipt can filter the client shows all

K

Karin

My customer is checking out and get billed, the tranaction is adding up the
services.
I am trying to print a receipt for this particlar client, but i cant filter
the client. My report shows all clients with transactions,
I am a beginner in filtering and the expressions can anyone help>\?
thanks
 
E

Evi

One basic method is like this

Let's say that the form which you are using to enter your data, contains a
number field, CustomerID and this field is the one by which you want to
filter your report- RptReceipt

In the form's design view, add a Command button and choose Report
Operations, Preview Report

Choose your report.

Right click on the command button and go to Properties.

On the Events tab click just right of On Click to open a code page

You will see something like this:

Private Sub CommandButtonsName_Click()
On Error GoTo Err_CommandButtonsName_Click

Dim stDocName As String

stDocName = "RptReceipt"
DoCmd.OpenReport stDocName, acPreview

Exit_CommandButtonsName_Click:
Exit Sub

Err_CommandButtonsName_Click:
MsgBox Err.Description
Resume Exit_CommandButtonsName_Click

End Sub


Edit the line that starts with DoCmd so that it now reads 1 line which says

DoCmd.OpenReport stDocName, acPreview, , "[CustomerID]=" & Me.[CustomerID]

(note there are 2 commas after acPreview)

The Me.CustomerID means that the code is looking at what is in the
CustomerID field in your form (that's the Me bit) and matching it with
CustomerID in your report


Substitue the words RptReciept and CustomerID with the names of your real
report and the field.by which you want to filter

Evi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top