I have a form with a subform that opens in a specific record using this:
I have now created a report (rptEstfrm) which contains a report and subreport (same as form above) and needs to display the same info as the form, thus it need to show the same record.
How can I open the report on that same record?
mafhob
Code:
Private Sub Form_Load()
Dim CallIDVar As Integer
Dim rs As Object
CallIDVar = Forms![contacts]![Call Listing Subform].Form![CallID]
Set rs = Me.Recordset.Clone
rs.FindFirst "[CallID] = " & CallIDVar
If rs.NoMatch Then
rs.AddNew
rs![CallID] = CallIDVar
rs.Update
Me.Requery
rs.FindFirst "[CallID]=" & CallIDVar
Me.Bookmark = rs.Bookmark
Else
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End Sub
I have now created a report (rptEstfrm) which contains a report and subreport (same as form above) and needs to display the same info as the form, thus it need to show the same record.
How can I open the report on that same record?
mafhob