M
Microsoft
Greetings,
I have several reports that I create with buttons on a form. The code that
creates the report uses the current last name on the form to go to report
the proper record. I have a subform on the form that lists the individual
stays of guests from the form. The code below works fine for getting the
record for the current guest on the form. But many guests have several
records on the subform The code below just creates reports fopr all records
on the subform for the current guest record. While this is ok, I would
rather have the ability to only crate a report forthe current record on the
subform for the current guest. Is there a way to modify the below code to
do this?
Many thanks,
Scott B
Private Sub cmdWelcomeCard_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "rptWelcomeCard"
strCriteria = "[LastName]='" & Me![LastName] & "'"
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub
I have several reports that I create with buttons on a form. The code that
creates the report uses the current last name on the form to go to report
the proper record. I have a subform on the form that lists the individual
stays of guests from the form. The code below works fine for getting the
record for the current guest on the form. But many guests have several
records on the subform The code below just creates reports fopr all records
on the subform for the current guest record. While this is ok, I would
rather have the ability to only crate a report forthe current record on the
subform for the current guest. Is there a way to modify the below code to
do this?
Many thanks,
Scott B
Private Sub cmdWelcomeCard_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "rptWelcomeCard"
strCriteria = "[LastName]='" & Me![LastName] & "'"
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub