Filter by Form Button

gschimek

Registered User.
Local time
Today, 13:38
Joined
Oct 2, 2006
Messages
102
I think this one will be pretty easy, but I'm not finding an answer. I just want to create a button that will do the same as clicking Records, Filter, Filter by Form. I've gotten the button wizard to give me buttons to apply a filter, and edit a filter, but not filter by form.

On a side note, maybe you can tell me if I'm heading in the right direction on this problem. I want to be able to give users the ability to filter and find certain records. Everyone who works for XYZ Company, for example. Then I want to be able to get those records exported to Word for a mail merge. My thought was that I could filter the appropriate records, mark them all, and then put them into a query. Then I would be able to access that query from Word for the mail merge.

Am I thinking correctly, or is there an easier way to do it?
 
Have you looked into making a custom toolbar? Use the filter buttons there. Access does it for you. For example.... Highlight your field .... company XYZ.... Hit the "lightning bolt" and bang.... you only see "XYZ" records.
 
You don't put records in a query. Queries are used (amongst many other things) to display tables. All you need is the table with everything (Company ABC, DEF, GHI, and XYZ) and then you query the table.

For example:

Code:
[u]Company[/u]  [u]Data[/u]
ABC      blah blah
ABC      more blah blah
DEF      less blah blah

To get only company ABC the query would be:

SELECT * FROM YourTableName WHERE Company='ABC';

For DEF, it would be:

SELECT * FROM YourTableName WHERE Company='DEF';

For everything, kill the WHERE clause:

SELECT * FROM YourTableName;
 
I'll give the custom toolbar a try. That's a pretty good idea.

Moniker: Sorry, I don't think I was very clear. What I was thinking I would do is create a query on the table that's already being used for my main form. That query would show only the records that I have "marked" with a check box after filtering. Then, if I've marked all the records from XYZ company, only those records would show up in my query, and then I'd use that query for my mail merge. But...I still don't know if that's the best way to do what I want, so any other suggestions would be appreciated. Otherwise, I'll give that a shot.
 
To take it further you can also use both Monikers suggestion and your checkbox.... Add a checkbox to your table. Then your query for only those records checked would be ....SELECT * FROM YourTableName WHERE Checkbox=True;
Many ways to get to where you want to go...What you want to do with the results will decide which method.
 

Users who are viewing this thread

Back
Top Bottom