You should try doing a search of the forum. There are many database examples of search forms. Most of which use a temp query or SQL which becomes the record source of your subform.
Here is a sample in Access 97 format. I don't remember who gave this to me (someone in this forum by chance?). This one creates a temp query to use as the record source for a list.
Hope this helps,
Vassago