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

Help with filter command and buttons

Status
Not open for further replies.

thowe

Technical User
Jun 8, 2001
45
US
Hello-
I am trying to open a form from my switchboard using a button that utilizes a macro. My trouble starts here. I would like the form to open completely blank (with no data) so I can type in the data that I want- and press a button that returns only records that match the data that I have typed in.(is this a filtering issue?) Is this possible? I would ideally like to use the macros feature that is built into Access 97 (I don't understand code)Please if you know how to do this I would love to know. Thank you in advance.
 
Maybe this will help get you started.
It sounds as like you want to use an unbound form with several text boxes. Then use a command button to open a query that uses the values in the text box as parameters to "filter" the data.
Let me know if you need more help than this.
Ken
 
Yes, this is what I want, but I think I need more information.
 
Hello,
sorry the late reply - I started my weekend early.
Start with a blank form and name it something (for example MyFavoriteForm), add as many text boxes as you need to filter your data, then name each one something you'll remember (for example, txtFilter1). Next create a query based on the table you want to filter. Put all the fields ou want in the query. In the criteria row for the fields that want to filter enter the following:
Forms!MyFavoriteForm!txtFilter1
Remember that each time you put this in the same row is equivilent to the 'AND' operator, if it is in a different row it is the 'OR' operator.
It sounds like you want to just use 'AND', so put "Forms!MyFavoriteForm!txtFilter1" in the same row for each filtered field.
In other words;
For field1 use Forms!MyFavoriteForm!txtFilter1
For field2 use Forms!MyFavoriteForm!txtFilter2
.
.
etc...
Save the query.
Then put a command button (use the wizard) that will open the query that you just made.

Let me know if you need more details,
Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top