Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering problem

Status
Not open for further replies.

Boccle

Technical User
Feb 19, 2003
14
0
0
GB
Hi,

I have a form (frmSearch) based on a table (tblBooks) that displays the Title and Author (in text boxes) of books in a library.

I have added a command button 'Search Title' with the following code attached to the Click event:

Private Sub cmdSearchTitle -Click()

Dim frm As Form
Dim strMsg As String
Dim strInput As String
Dim strFilter As String

Set frm = Forms!frmSearch
strMsg = "Enter search criteria."
strInput = InputBox(strMsg)

strFilter = BuildCriteria("Title", dbText, strInput)

frm.Filter = strFilter
frm.FilterOn = True

End Sub

This is what happens when I click the button:
The Input box appears with the propt "Enter search criteria". I then type in a search term and click ok. Then another box appears with the title "Enter parameter value". The box contains a text box to enter this value in and above this box is the the search term entered in the previous input box as well as an OK and cancel button. Whichever button is clicked the filter does not appear to have worked.

Basically, I don't know where this second box is coming from or why!!! Especially as I managed to make this work previuosly and the second box never appeared!!!

Any ideas?????
 
If you are just searching for single records based on the value of one field.
send me an email to frank@fhsservices.co.uk title "search Form" and I will send you a working sample.
 
Did you happen to change the name of the table and or form? maybe I use the easy way out since I'm not much of a programmer, but I usually just run a query with the [Enter Title] as the criteria and have the query output to the form. The query acts as my filter. On the button, I usually have a macro that runs the query....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top