Filter report to only show current record

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

Guest

I have a report that displays data for payments collected from clients. This
report is grouped by the clients name with their various fees listed below
their name. What I need to do is print reports for an indiviual. Each client
is assigned a File Number (which I have a field for). I want to filter the
report to only show records with a file number that can be entered on an
unbound form. any suggestions?
 
You can use the Where argument of the OpenReport method. See details in VBA
Help.

Docmd.OpenReport "ClientPayments", acViewPreview, , "[FileNumber] = " &
Me.txtFileNumber

Where txtFileNumber is a text box on the form that has the client's file
number.
 
Can't seem to get it to work. Report still shows all clients (all file
numbers). Maybe I should mention that the file number is stored in the main
table (along with client name, etc) and that table is related (one to many)
to the table which holds the payments/fee data. I have a form that uses the
client info table as a record source and a subform that uses the payment/fee
table as a record source. The report I'm running uses a query with fields
from both tables.

Klatuu said:
You can use the Where argument of the OpenReport method. See details in VBA
Help.

Docmd.OpenReport "ClientPayments", acViewPreview, , "[FileNumber] = " &
Me.txtFileNumber

Where txtFileNumber is a text box on the form that has the client's file
number.
--
Dave Hargis, Microsoft Access MVP


robertm600635 said:
I have a report that displays data for payments collected from clients. This
report is grouped by the clients name with their various fees listed below
their name. What I need to do is print reports for an indiviual. Each client
is assigned a File Number (which I have a field for). I want to filter the
report to only show records with a file number that can be entered on an
unbound form. any suggestions?
 
Is FileNumber number or text. If it is text, it needs quotes around it:
"[FileNumber] = '" & Me.txtFileNumber & "'"
--
Dave Hargis, Microsoft Access MVP


robertm600635 said:
Can't seem to get it to work. Report still shows all clients (all file
numbers). Maybe I should mention that the file number is stored in the main
table (along with client name, etc) and that table is related (one to many)
to the table which holds the payments/fee data. I have a form that uses the
client info table as a record source and a subform that uses the payment/fee
table as a record source. The report I'm running uses a query with fields
from both tables.

Klatuu said:
You can use the Where argument of the OpenReport method. See details in VBA
Help.

Docmd.OpenReport "ClientPayments", acViewPreview, , "[FileNumber] = " &
Me.txtFileNumber

Where txtFileNumber is a text box on the form that has the client's file
number.
--
Dave Hargis, Microsoft Access MVP


robertm600635 said:
I have a report that displays data for payments collected from clients. This
report is grouped by the clients name with their various fees listed below
their name. What I need to do is print reports for an indiviual. Each client
is assigned a File Number (which I have a field for). I want to filter the
report to only show records with a file number that can be entered on an
unbound form. any suggestions?
 
Works like a charm now, thanks for your quick replies.

Klatuu said:
Is FileNumber number or text. If it is text, it needs quotes around it:
"[FileNumber] = '" & Me.txtFileNumber & "'"
--
Dave Hargis, Microsoft Access MVP


robertm600635 said:
Can't seem to get it to work. Report still shows all clients (all file
numbers). Maybe I should mention that the file number is stored in the main
table (along with client name, etc) and that table is related (one to many)
to the table which holds the payments/fee data. I have a form that uses the
client info table as a record source and a subform that uses the payment/fee
table as a record source. The report I'm running uses a query with fields
from both tables.

Klatuu said:
You can use the Where argument of the OpenReport method. See details in VBA
Help.

Docmd.OpenReport "ClientPayments", acViewPreview, , "[FileNumber] = " &
Me.txtFileNumber

Where txtFileNumber is a text box on the form that has the client's file
number.
--
Dave Hargis, Microsoft Access MVP


:

I have a report that displays data for payments collected from clients. This
report is grouped by the clients name with their various fees listed below
their name. What I need to do is print reports for an indiviual. Each client
is assigned a File Number (which I have a field for). I want to filter the
report to only show records with a file number that can be entered on an
unbound form. any suggestions?
 
Back
Top