I currently have a button that I click that will open a report and pass the current record to the report. See below:
Code:
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "CoC1", acViewPreview, , strWhere
End If
End Sub
I have the need to print full page graphics in the report though that are displayed through an ActiveX control that is dropped on the report. In order to do this and stay within the 22" requirement of a report, I have decided to use subreports. (Help me if I'm wrong).
The issue I am having is, how do I pass the values of the current record on button press to not only the main report, but also the subreports. I tried cheating and adding lines the the above code such as:
Code:
DoCmd.OpenReport "Picture1", acViewPreview, , , acHidden, strWhere
But that obviously didn't work.
Can anyone give me some insight as to how I would be able to pull the selected record via button push and pass that data to multiple subreport inside of the main.