M
Misty
I have created the following in Access 2003. When I converted to Office 2007
- it no longer worked, and I can't figure out what I am missing:
In a form
I needed the form to be able to filter on the click of a button
So I created a place to type in a word (called it txtKeyword)
Created an option group (to be able to choose the field to search on)
Then created a button (on click it filters based on the option/keyword chosen)
The code is that applies to this is:
Private Sub cmdFilter_Click()
If optChoice = 1 Then
DoCmd.ApplyFilter "qfltBidItems", "[Item] Like '*'&
[Forms]![frmMasterBidItems]![txtKeyword]& '*' "
ElseIf optChoice = 2 Then
DoCmd.ApplyFilter "qfltBidItems", "[ItemCode] Like '*'&
[Forms]![frmMasterBidItems]![txtKeyword]& '*' "
ElseIf optChoice = 3 Then
DoCmd.ApplyFilter "qfltBidItems", "[SpecSection] Like '*'&
[Forms]![frmMasterBidItems]![txtKeyword]& '*' "
End If
qfltBidItems = query
[itemCode]=field to search
frmMasterBidItems - form they are in when they type ina keyword to search
Any suggestions??
- it no longer worked, and I can't figure out what I am missing:
In a form
I needed the form to be able to filter on the click of a button
So I created a place to type in a word (called it txtKeyword)
Created an option group (to be able to choose the field to search on)
Then created a button (on click it filters based on the option/keyword chosen)
The code is that applies to this is:
Private Sub cmdFilter_Click()
If optChoice = 1 Then
DoCmd.ApplyFilter "qfltBidItems", "[Item] Like '*'&
[Forms]![frmMasterBidItems]![txtKeyword]& '*' "
ElseIf optChoice = 2 Then
DoCmd.ApplyFilter "qfltBidItems", "[ItemCode] Like '*'&
[Forms]![frmMasterBidItems]![txtKeyword]& '*' "
ElseIf optChoice = 3 Then
DoCmd.ApplyFilter "qfltBidItems", "[SpecSection] Like '*'&
[Forms]![frmMasterBidItems]![txtKeyword]& '*' "
End If
qfltBidItems = query
[itemCode]=field to search
frmMasterBidItems - form they are in when they type ina keyword to search
Any suggestions??