Limiting Report Records

G

GeorgeB

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
 
F

fredg

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.
 
G

GeorgeB

----- 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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top