View Full Version : perform search in Form


lamha
08-15-2000, 11:29 AM
I have an unbound text box and a Find command. If the user enter the ItemID and click Find, I want the subform to display data for that item. Does anyone know how to do this? I don't want to use combo box because the tblItem is forever long.
Thanks for any help in advance.

gino
08-17-2000, 07:55 AM
the find command (Ctrl+F) is MSAccess default finding tool therefore it limits your options. yes, an unbound text box is the better route on finding a specific record. use a query to find specific records. in this case you insert this code under ItemID criteria in your query.

=[forms]![nameofyourform].[unboundfield]

then from your unbound field on your form you would insert data then click on a command button to pull up that query to bring up your specific criteria based on the unbound field. i can't fully explain myself but if you need help just let us all know.

[This message has been edited by gino (edited 08-17-2000).]

lamha
08-17-2000, 09:42 AM
I tried as you suggested. When I click the Run Query cmd button, the query pop up instead. The subform is blank.

gino
08-17-2000, 11:57 AM
your subform should be based on the query you designed.......

lamha
08-18-2000, 04:06 AM
Still the same problem.

gino
09-08-2000, 01:59 PM
i'm sorry to reply so late. got caught up at work. try requery.

put this in a command button on your main form

Me.subform.Requery

after filling in unbound fields requery should update the query you created. Your sub form should update.



[This message has been edited by gino (edited 09-08-2000).]

Richie
09-09-2000, 11:44 PM
How is the find method supplied by access limited? I add a call function to the double click event of several text boxes on the main form if the data in the main / sub is linked correctly the subform will display accordingly, the options to search by part of field I find much faster than a combo / unbound text box.

lamha
09-10-2000, 04:09 AM
Thanks for all of your help. I found another solution for this. I made a separate search form that search for part of the field, and open the form with subforms later.