How to print a specified record number

  • Thread starter Thread starter Danny
  • Start date Start date
D

Danny

Hi,


What command can I use to print a specified record number.
For example, if user is asked which record they would like
to print and they enter, say record number 4; what command
can I use to print that record only?

I found DoCmd.PrinOut ... but you can only specify the
pages you want to print not the record you want.

Thank you
 
Danny said:
Hi,


What command can I use to print a specified record number.
For example, if user is asked which record they would like
to print and they enter, say record number 4; what command
can I use to print that record only?

I found DoCmd.PrinOut ... but you can only specify the
pages you want to print not the record you want.

Thank you

What does that mean: "record number"? Seriously, there is no fixed
"record number" in Access -- the order in which you see records
presented now may not be the same as what you see later, when other
records have been added or the records are sorted differently. The only
way to reliably identify a record for later reference is by using the
record's primary key, or some other field or combination of fields that
constitute a unique index.

Given a record's primary key, you can specify it as a where-condition
condition for opening a report, like this:

DoCmd.OpenReport "ReportName", _
WhereCondition:="RecordID=" & Me.txtRecordIDtoPrint

(where "RecordID" is the name of the primary key field in this example).
 
Back
Top