Limiting Report Records

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

Guest

I have a library catalog form with a report printing button. However, I want the catalog report to only print the current record onscreen when the button is pressed. I was looking at everything from the CurrentRecord Property to OpenArgs, etc. and I just get more confused. Any help is much appreciated. Thanks! George
 
GeorgeB said:
I have a library catalog form with a report printing button. However, I
want the catalog report to only print the current record onscreen when
the button is pressed. I was looking at everything from the
CurrentRecord Property to OpenArgs, etc. and I just get more confused.
Any help is much appreciated. Thanks! George
George,

Your Table should have a unique prime key field that uniquely identifies
each record.

If that field is a Number datatype, then:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]

Change [RecordID] to whatever the actual name of your prime key field
is.
 
----- fredg wrote: -----
I have a library catalog form with a report printing button. However, I
want the catalog report to only print the current record onscreen when
the button is pressed. I was looking at everything from the
CurrentRecord Property to OpenArgs, etc. and I just get more confused.
Any help is much appreciated. Thanks! George
George,

Your Table should have a unique prime key field that uniquely identifies
each record.

If that field is a Number datatype, then:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]

Change [RecordID] to whatever the actual name of your prime key field
is.


--
Fred
Please reply only to this newsgroup.
I do not respond to personal e-mail.

Thank you, Fred. I'll give it a try. Thinking about it, it makes sense!
 
Back
Top