Print current record in a report

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

Guest

I have designed a report to print all details of members. I want to put a
Control on the form that will print only the current record that is on the
screen. I can create the control no problem, but how do get just the current
record to print and not all records. Can I create a query for this or how?
Thanks
 
Roger said:
I have designed a report to print all details of members. I want to put a
Control on the form that will print only the current record that is on the
screen. I can create the control no problem, but how do get just the current
record to print and not all records. Can I create a query for this or how?


Use the OpenReport method's WhereCondition argument in the
button's procedure. The command button wizard will generate
most of the code so you only need to modify it to look like:

Dim stDocName As String
Dim stCriteria As String
stDocName = "AbsencesSkipGroup"
stCriteria = "keyfield = " & me.keyfield
DoCmd.OpenReport stDocName, acPreview, , stCriteria

where keyfield is the name of the table's primary key field.
 
Back
Top