G
Gator
Most of the code here is just FYI....my question really gets to the
TabCtl0_Change() event. The Filter works well with the Multiselect set as
None. How would I adjust the code to make the Filter work with Multiselect
set at Simple?
thanks
Private Sub Frame17_Click()
If Frame17.Value = 1 Then
List15.RowSource = "SELECT Format((DateDep),'yyyymm'),
Format(SUM(Amount),'currency'), Account FROM Deposits WHERE (Account='" &
List13 & "') AND (Fund='" & List11 & "') GROUP BY Format((DateDep),'yyyymm'),
Account ORDER BY Format((DateDep),'yyyymm') DESC;"
Else
List15.RowSource = "SELECT Format((DateDep),'yyyy'),
Format(SUM(Amount),'currency'), Account FROM Deposits WHERE (Account='" &
List13 & "') AND (Fund='" & List11 & "') GROUP BY Format((DateDep),'yyyy'),
Account ORDER BY Format((DateDep),'yyyy') DESC;"
End If
End Sub
Private Sub List11_Click()
List13.RowSource = "SELECT Account, AccountName, Fund FROM Deposits WHERE
(Fund= '" & List11 & "') GROUP BY Account, AccountName, Fund;"
End Sub
Private Sub List13_Click()
If Frame17.Value = 1 Then
List15.RowSource = "SELECT Format((DateDep),'yyyymm'),
Format(SUM(Amount),'currency'), Account FROM Deposits WHERE (Account='" &
List13 & "') AND (Fund='" & List11 & "') GROUP BY Format((DateDep),'yyyymm'),
Account ORDER BY Format((DateDep),'yyyymm') DESC;"
Else
List15.RowSource = "SELECT Format((DateDep),'yyyy'),
Format(SUM(Amount),'currency'), Account FROM Deposits WHERE (Account='" &
List13 & "') AND (Fund='" & List11 & "') GROUP BY Format((DateDep),'yyyy'),
Account ORDER BY Format((DateDep),'yyyy') DESC;"
End If
End Sub
Private Sub TabCtl0_Change()
Dim strFilter As String
With Me.TabCtl0
strFilter = "(Deposits.Account='" & List13 & "') AND (Deposits.Fund='" &
List11 & "') AND ((Year(Deposits.DateDep))='" & (Left(List15.Column(0), 4)) &
"') AND ((Month(Deposits.DateDep))='" & (Right(List15.Column(0), 2)) & "')"
End With
With Me.Deposits_subform.Form
..Filter = strFilter
..FilterOn = True
..OrderBy = "DateDep DESC"
..OrderByOn = True
End With
End Sub
TabCtl0_Change() event. The Filter works well with the Multiselect set as
None. How would I adjust the code to make the Filter work with Multiselect
set at Simple?
thanks
Private Sub Frame17_Click()
If Frame17.Value = 1 Then
List15.RowSource = "SELECT Format((DateDep),'yyyymm'),
Format(SUM(Amount),'currency'), Account FROM Deposits WHERE (Account='" &
List13 & "') AND (Fund='" & List11 & "') GROUP BY Format((DateDep),'yyyymm'),
Account ORDER BY Format((DateDep),'yyyymm') DESC;"
Else
List15.RowSource = "SELECT Format((DateDep),'yyyy'),
Format(SUM(Amount),'currency'), Account FROM Deposits WHERE (Account='" &
List13 & "') AND (Fund='" & List11 & "') GROUP BY Format((DateDep),'yyyy'),
Account ORDER BY Format((DateDep),'yyyy') DESC;"
End If
End Sub
Private Sub List11_Click()
List13.RowSource = "SELECT Account, AccountName, Fund FROM Deposits WHERE
(Fund= '" & List11 & "') GROUP BY Account, AccountName, Fund;"
End Sub
Private Sub List13_Click()
If Frame17.Value = 1 Then
List15.RowSource = "SELECT Format((DateDep),'yyyymm'),
Format(SUM(Amount),'currency'), Account FROM Deposits WHERE (Account='" &
List13 & "') AND (Fund='" & List11 & "') GROUP BY Format((DateDep),'yyyymm'),
Account ORDER BY Format((DateDep),'yyyymm') DESC;"
Else
List15.RowSource = "SELECT Format((DateDep),'yyyy'),
Format(SUM(Amount),'currency'), Account FROM Deposits WHERE (Account='" &
List13 & "') AND (Fund='" & List11 & "') GROUP BY Format((DateDep),'yyyy'),
Account ORDER BY Format((DateDep),'yyyy') DESC;"
End If
End Sub
Private Sub TabCtl0_Change()
Dim strFilter As String
With Me.TabCtl0
strFilter = "(Deposits.Account='" & List13 & "') AND (Deposits.Fund='" &
List11 & "') AND ((Year(Deposits.DateDep))='" & (Left(List15.Column(0), 4)) &
"') AND ((Month(Deposits.DateDep))='" & (Right(List15.Column(0), 2)) & "')"
End With
With Me.Deposits_subform.Form
..Filter = strFilter
..FilterOn = True
..OrderBy = "DateDep DESC"
..OrderByOn = True
End With
End Sub