In the OnClick event of the command button, you can place a Select Case statement such as: (The 1,2,3,4,5 are the postions of the options in the option group)
Private Sub Command9_Click()
Dim WClause, RName
Select Case [RptFrame]
Case 1
WClause = "[DateOfLease] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_And_Leasing_Rpt"
Case 2
WClause = "[FinalSettlementDate]is null"
RName = "Sales_Pending_Report"
Case 3
WClause = "[FinalSettlementDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_Report"
Case 4
WClause = "[FinalSettlementDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Sales_Report_Monthly"
Case 5
WClause = "[ReviewedDate] Between #" & _
Me![Start] & "# AND #" & _
Me![End] & "#"
RName = "Reag_Review_Date_Count_Rpt"
End Select
DoCmd.OpenReport _
ReportName:=RName, _
WhereCondition:=WClause, _
view:=Me![OutputTo]
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.