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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a dynamic Query?

Status
Not open for further replies.

PithPossium

Technical User
Oct 1, 2001
1
CA
I'm new to Access. I've created a table called contacts that has the common fields for contacts (eg. FName, LName, Address ....)

I want to creat a form in which our Admin Assistant can Search by Last Name, Title, or Comapny. I need to know how to Query the table with the fields in the Form.

The Form is called SearchForm and the textboxes are called LName, Title, and Company.

I'm not asking for a complete solution. But it would be very helpful is someone could give me a start in the right direction.

Thanks,

Pith
 
Your form will have two parts. The top part will include your search fields, and the text boxes will be unbound.

The bottom part of the form will be a sub-form, based on a parameter query.

The paramater query will contain the criteria. In the Fname field, your criteria will be like "*" & [forms].[yourformname].[yourunboundtextbox1] & "*". The same holds true for any additional fields.

Your form will also have one command button. It's code will be:

Me.Requery

That's it !!! Tyrone Lumley
augerinn@gte.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top