jonman1124
Technical User
Hi, I am fairly new to Access as well as VBA.
My current setup has a report called "qall summary" which is generated by a bunch of queries all going back to a single query which collects the raw data together, called qall. I want to be able to:
1) generate this report based on ALL the data queried by qall
2) generate this report based after filtering the data generated by qall on a field called sellers, pulling only the information where sellers = 'CIBC'
3) same as #2 where sellers <> 'CIBC'
what i have right now is a form called report_switchboard where can click on an option group to filter the data generated by qall, but when i click on the button to preview the report, i see a report based on all the data, regardless of which option button i chose. I can see that the data has been filtered when i click on the option buttons, but the report does not reflect that. can someone help out?
this is what my code looks like:
Private Sub Preview_Click() 'preview one of two reports
Dim strreporttype As String
If reporttype = 1 Then
strreporttype = "all summary" 'percentage based report
Else
strreporttype = "all summary delinq loan count" 'count based
End If
DoCmd.OpenReport strreporttype, acViewPreview
DoCmd.Close acForm, "report_switchboard"
End Sub
-----------------------------------------------
Private Sub selleroption_AfterUpdate()
'apply or remove the filter for the option the user chose.
Select Case selleroption
Case 1
Me.Filter = "seller = 'CIBC'"
Me.FilterOn = True
Case 2
Me.Filter = "seller <> 'CIBC'"
Me.FilterOn = True
Case 3
Me.FilterOn = False
End Select
End Sub
My current setup has a report called "qall summary" which is generated by a bunch of queries all going back to a single query which collects the raw data together, called qall. I want to be able to:
1) generate this report based on ALL the data queried by qall
2) generate this report based after filtering the data generated by qall on a field called sellers, pulling only the information where sellers = 'CIBC'
3) same as #2 where sellers <> 'CIBC'
what i have right now is a form called report_switchboard where can click on an option group to filter the data generated by qall, but when i click on the button to preview the report, i see a report based on all the data, regardless of which option button i chose. I can see that the data has been filtered when i click on the option buttons, but the report does not reflect that. can someone help out?
this is what my code looks like:
Private Sub Preview_Click() 'preview one of two reports
Dim strreporttype As String
If reporttype = 1 Then
strreporttype = "all summary" 'percentage based report
Else
strreporttype = "all summary delinq loan count" 'count based
End If
DoCmd.OpenReport strreporttype, acViewPreview
DoCmd.Close acForm, "report_switchboard"
End Sub
-----------------------------------------------
Private Sub selleroption_AfterUpdate()
'apply or remove the filter for the option the user chose.
Select Case selleroption
Case 1
Me.Filter = "seller = 'CIBC'"
Me.FilterOn = True
Case 2
Me.Filter = "seller <> 'CIBC'"
Me.FilterOn = True
Case 3
Me.FilterOn = False
End Select
End Sub