Link Criteria in Report

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

Guest

Hi, there,

I am working on an invoice form, and I made a report form instead of using
form print function.

I used a blank report to create the invoice report.

When I preview the report from invoice form view, it displays the first
record, not current record in form view. Moreover, it also displays all
invoice detail records, not specific records which belong to a specific
customer in the same invoice form view.

The invoice form has a invoice detail subform which contains items and prices.

Key fields in the form
[invid] invoice id
[invcid] invoice customer id
[indid] invoice detail id
[iid] item id

I think I may solve this problem by directing link criteria ([invid]) from
the invoice form view to the invoice report, or I maybe wrong.

It displays the first record of the invoice table and all records from
invoice detail table now, please help.

Thank you very much for your time.
 
Hi Stephen,

Presumably you opening the report via code, using a DoCmd.OpenReport
statement. Add a Where parameter to the command, as follows:
DoCmd.OpenReport "YourReportName", , , "invid = " & Me.invid

If invid is a text field, rather than a number, you will need single-quote
delimiters around the invid:
DoCmd.OpenReport "YourReportName", , , "invid = '" & Me.invid & "'"
[Expanded for clarity, that last line is:
DoCmd.OpenReport "YourReportName", , , "invid = ' " & Me.invid & " '
]

HTH,

Rob
 
Thank you Rob.

It works like magic.

Rob Parker said:
Hi Stephen,

Presumably you opening the report via code, using a DoCmd.OpenReport
statement. Add a Where parameter to the command, as follows:
DoCmd.OpenReport "YourReportName", , , "invid = " & Me.invid

If invid is a text field, rather than a number, you will need single-quote
delimiters around the invid:
DoCmd.OpenReport "YourReportName", , , "invid = '" & Me.invid & "'"
[Expanded for clarity, that last line is:
DoCmd.OpenReport "YourReportName", , , "invid = ' " & Me.invid & " '
]

HTH,

Rob


Stephen said:
Hi, there,

I am working on an invoice form, and I made a report form instead of using
form print function.

I used a blank report to create the invoice report.

When I preview the report from invoice form view, it displays the first
record, not current record in form view. Moreover, it also displays all
invoice detail records, not specific records which belong to a specific
customer in the same invoice form view.

The invoice form has a invoice detail subform which contains items and
prices.

Key fields in the form
[invid] invoice id
[invcid] invoice customer id
[indid] invoice detail id
[iid] item id

I think I may solve this problem by directing link criteria ([invid]) from
the invoice form view to the invoice report, or I maybe wrong.

It displays the first record of the invoice table and all records from
invoice detail table now, please help.

Thank you very much for your time.
 
Back
Top