B
Brook
good day all,
I use a frmcheckingfilter that I use to filter my tblfinances based on
"accounttype" which could be "Checking, Checking/Expense, Checking/Loan,
Wire, or Expense". I currently use the same report for all filter options,
but I would like to have a different report if the user selects the "Expense"
filter option. Is that possible? My report names are rptfinances and
rptfinancialexpense.
does anyone have any ideas?
Below is my code for my apply filter command button:
Begin Code:
Private Sub cmdApplyFilter_Click()
Dim strtype1 As String
Dim strtype2 As String
Dim strFilter As String
' Check that the report is open
If SysCmd(acSysCmdGetObjectState, acReport, "rptchecking") <>
acObjStateOpen Then
MsgBox "You must open the report first."
Exit Sub
End If
' Build criteria string for Office field
If IsNull(Me.cboaccounttype1.Value) Then
strtype1 = "Like '*'"
Else
strtype1 = "='" & Me.cboaccounttype1.Value & "'"
End If
' Build criteria string for Department field
If IsNull(Me.cboaccounttype2.Value) Then
strtype2 = "Like '*'"
Else
strtype2 = "='" & Me.cboaccounttype2.Value & "'"
End If
' Combine criteria strings into a WHERE clause for the filter
strFilter = "[AccountType] " & strtype1 & " OR [AccountType] " & strtype2
' Apply the filter and switch it o
With Reports![rptchecking]
.Filter = strFilter
.FilterOn = True
End With
End Sub
End Code
Thanks for any tips suggestions..
Brook
I use a frmcheckingfilter that I use to filter my tblfinances based on
"accounttype" which could be "Checking, Checking/Expense, Checking/Loan,
Wire, or Expense". I currently use the same report for all filter options,
but I would like to have a different report if the user selects the "Expense"
filter option. Is that possible? My report names are rptfinances and
rptfinancialexpense.
does anyone have any ideas?
Below is my code for my apply filter command button:
Begin Code:
Private Sub cmdApplyFilter_Click()
Dim strtype1 As String
Dim strtype2 As String
Dim strFilter As String
' Check that the report is open
If SysCmd(acSysCmdGetObjectState, acReport, "rptchecking") <>
acObjStateOpen Then
MsgBox "You must open the report first."
Exit Sub
End If
' Build criteria string for Office field
If IsNull(Me.cboaccounttype1.Value) Then
strtype1 = "Like '*'"
Else
strtype1 = "='" & Me.cboaccounttype1.Value & "'"
End If
' Build criteria string for Department field
If IsNull(Me.cboaccounttype2.Value) Then
strtype2 = "Like '*'"
Else
strtype2 = "='" & Me.cboaccounttype2.Value & "'"
End If
' Combine criteria strings into a WHERE clause for the filter
strFilter = "[AccountType] " & strtype1 & " OR [AccountType] " & strtype2
' Apply the filter and switch it o
With Reports![rptchecking]
.Filter = strFilter
.FilterOn = True
End With
End Sub
End Code
Thanks for any tips suggestions..
Brook