Filter a Filtered Form

Jenaccess

Registered User.
Local time
Today, 05:59
Joined
Sep 8, 2010
Messages
67
Hi,

I am using Access 2010 for this particular project, though I am familiar with Access 2007.

In my database I have a form that acts like a subform but is not embedded in my main form. I have a command button on my main form that opens the quasi-subform, which I'll call qs from now on, to the current record.

One of the fields on the qs is a checkbox called Inactive. There are potentially a lot of records on the qs, so I thought it would be a neat feature to have a button the user could click to view active records only. So, if the Inactive checkbox was clicked, that particular record would not show.

The problem is that when I try to filter the records on the qs, I get all active records, not only for the particular person (ID) I'm looking for, but for everyone else in the database who has a record on the qs. Is there a way I can code the button to provide only the active records of the current person (ID)? Thank you so much for your time!
 
Use the Where argument of the OpenForm Method to limit the records to the ID when it is opened.

Otherwise include the ID as a criteria in the filter along with the Inactive condition..
 
Thank you for your reply! I had been using the Where Method to filter the ID. I tried setting up the ID and the inactive criteria but I needed it to toggle between both the ID and inactive criteria and just the ID. I came close a few times, but was never able to get exactly what I wanted. I figured out that it wasn't a question of a filtered/unfiltered toggle state; it was more like filter1/filter2. I finally decided to go with option buttons, and it works very well. I'm always willing to learn new things, so if you think there's a better/more efficient solution, I'd love to hear it. Again, thank you!
 

Users who are viewing this thread

Back
Top Bottom