Access 2007

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??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top