Print Current Record Report

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

I've either never done this before or I've suddenly gone brain-dead...

I want to print the current record as a report (so that I can select
individual fields and format the output etc) but I just can't work out the
criteria I need to add to the query that feeds the report.

TIA
Terry
 
Terry said:
I've either never done this before or I've suddenly gone brain-dead...

I want to print the current record as a report (so that I can select
individual fields and format the output etc) but I just can't work out the
criteria I need to add to the query that feeds the report.

TIA
Terry
Terry,
If you are talking of a 'current record' then you are using a form,
right?

Add a command button to your form.
Code it's Click event:
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
Me![RecordID]


The above assumes [RecordID] is the name of your records unique prime
key field, and it is a Number datatype.
Change [RecordID] to whatever the actual name is of that field.

See Access Help files regarding:
OpenReport method
Where Clause + Restrict data to a subset of records
 
I want to print the current record as a report (so that I can select
If you are talking of a 'current record' then you are using a form,
right?

<code snipped>

Yeah, it's from a form. It's coming back to me now. I seem to remember
adding [forms].[formname].[RecordID] as criteria to a query and having the
query feed the report, which ran similarly from a form button. However, the
method you illustrated is more efficient. Thanks for that.
See Access Help files regarding:
OpenReport method
Where Clause + Restrict data to a subset of records

Thanks for that too.

Terry
 
Back
Top