Printing Report Via Form (one record only please!)

  • Thread starter Thread starter Jack Higgs
  • Start date Start date
J

Jack Higgs

I've got a control on my Form for the bookings that prints the invoice
reports I've produced. The report has a different page for each record. How
do I program it to just print off the one record, corresponding to the
current form data. VbCode would be nice.

Jack
 
Just restrict the report using the "where" clause.

me.Refresh ' force a disk write
docmd.OpenReport "yourReport",acViewPreview,,"id = " * me.id
 
Albert D. Kallal said:
Just restrict the report using the "where" clause.

me.Refresh ' force a disk write
docmd.OpenReport "yourReport",acViewPreview,,"id = " * me.id

Thanks for your reply, I've got that far, but I don't quite understand what
I'm ment to put in the "id = " * me.id bit.

Cheers,

Jack
 
Jack,

I'm sure Albert meant to type an & instead of an *. Try it that way and
you will have a WHERE clause without the WHERE, the presumption being that
you have a field/control on your form which uniquely identifies the record
(me.id) which will match to the "id" field on your report. You would need
to change "id" in your use of this code to reflect your field name.
 
Cheryl Fischer said:
Jack,

I'm sure Albert meant to type an & instead of an *. Try it that way and
you will have a WHERE clause without the WHERE, the presumption being that
you have a field/control on your form which uniquely identifies the record
(me.id) which will match to the "id" field on your report. You would need
to change "id" in your use of this code to reflect your field name.

Brilliant! All working now, thank you for your help, I appreciate it a lot.

Cheers,

Jack
 
Back
Top