P
Please help James
Does anyone know how make an option group affect the filter of a combo box?
I have a combo box that has DR and CR, and an option group 100 and 200. If a
user selects option 100 I would like to see only items associated with CR and
if the user selects 200, then only items associated with DR would appear in
the combo box. Below is what I have so far.....but it just doesn't work.
Any help is very much appreciated. Thanks!
Private Sub Frame309_AfterUpdate()
Dim strSql As String
strSql = "SELECT qcatsub1.CategoryName, qcatsub1.frombankname,
qcatsub1.frombankacctnumber FROM qcatsub1"
If Frame309 = 100 Then
Me.Filter = "qcatsub1.transtype = 'CR'"
Me.FilterOn = True
strSql = strSql & "WHERE qcatsub1.transtype = 'CR'"
ElseIf Frame309 = 200 Then
Me.Filter = "qcatsub1.transtype = 'DR'"
Me.FilterOn = True
strSql = strSql & "WHERE qcatsub1.transtype = 'DR'"
End If
strSql = strSql & " ORDER BY [CategoryName], [frombankacctnumber],
[frombankname];"
Me.Combo276.RowSource = strSql
End Sub
I have a combo box that has DR and CR, and an option group 100 and 200. If a
user selects option 100 I would like to see only items associated with CR and
if the user selects 200, then only items associated with DR would appear in
the combo box. Below is what I have so far.....but it just doesn't work.
Any help is very much appreciated. Thanks!
Private Sub Frame309_AfterUpdate()
Dim strSql As String
strSql = "SELECT qcatsub1.CategoryName, qcatsub1.frombankname,
qcatsub1.frombankacctnumber FROM qcatsub1"
If Frame309 = 100 Then
Me.Filter = "qcatsub1.transtype = 'CR'"
Me.FilterOn = True
strSql = strSql & "WHERE qcatsub1.transtype = 'CR'"
ElseIf Frame309 = 200 Then
Me.Filter = "qcatsub1.transtype = 'DR'"
Me.FilterOn = True
strSql = strSql & "WHERE qcatsub1.transtype = 'DR'"
End If
strSql = strSql & " ORDER BY [CategoryName], [frombankacctnumber],
[frombankname];"
Me.Combo276.RowSource = strSql
End Sub