I need to run a report with different options. I have two Option Groups on my form with the following code on open of my report:
Private Sub Report_Open(Cancel As Integer)
If Forms!frmPrintCheckRegister!FrameSort.Value = 1 Then
Me.OrderBy = "CheckDate"
End If
If Forms!frmPrintCheckRegister!FrameSort.Value = 2 Then
Me.OrderBy = "CheckNumber"
End If
If Forms!frmPrintCheckRegister!FrameSort.Value = 3 Then
Me.OrderBy = "CategoryName"
End If
End Sub
The problem is I can't add the correct code to also change the recordsource ( the other Option Group) when the report opens.
Any suggestions? Thanks.
Private Sub Report_Open(Cancel As Integer)
If Forms!frmPrintCheckRegister!FrameSort.Value = 1 Then
Me.OrderBy = "CheckDate"
End If
If Forms!frmPrintCheckRegister!FrameSort.Value = 2 Then
Me.OrderBy = "CheckNumber"
End If
If Forms!frmPrintCheckRegister!FrameSort.Value = 3 Then
Me.OrderBy = "CategoryName"
End If
End Sub
The problem is I can't add the correct code to also change the recordsource ( the other Option Group) when the report opens.
Any suggestions? Thanks.