Reporting from a single record

  • Thread starter Thread starter Eswift
  • Start date Start date
E

Eswift

I know just the basics of Access, and can create tables,
forms, and reports, but I can only report all records in
the database. I am attempting to be able to pull the
most recently entered record and report that single
record in different reports. Is this possible? Any help
in advance would be greatly appreciated. Thanks, E
 
Eswift said:
I know just the basics of Access, and can create tables,
forms, and reports, but I can only report all records in
the database. I am attempting to be able to pull the
most recently entered record and report that single
record in different reports. Is this possible? Any help
in advance would be greatly appreciated. Thanks, E


It is a standard practice to use a command button on a form
to open the report. If the form also displays the records
and the user selects the record they want to display in the
report, then the code in the button's Click event procedure
can easily construct the OpenReport's WhereCondition
argument string to filter the report's data.

Modify the button's wizard generated code so that it looks
something like:

Dim stDoc As String
Dim stWhere As String
stDoc = "nameofreport"
stWhere = "keyfieldname = " & Me.keyfieldname
DoCmd.OpenReport stDoc, , , stWhere
 
Thank you very much for your quick reply. It makes
perfect sense. I will give it a try and get back to you.
Once again, thanks. - E
 
Back
Top