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

Filter Records on Form

Status
Not open for further replies.

jer007

Technical User
Feb 16, 2004
94
CA
I've been searching the site for this one but I can't seem to find exactly what I'm looking for.

I have a form that I want filtered so that when it opens, only the records with a check box value "true" will be displayed. at the same time, I would need to be able to enter new records with this filter on.

What would be the best method to do this? Would it be with VBA code in the On Open event?

Thanks for any help

Jeremy
 
What is your data source? You can do it with a query to limit the records to the "true" value and make this query your data source. Provided the field that is T/F is on the form, records could be added that are either T or F. A requery after adding the records will then always show only the T records.
 
Thanks jdemmer

The query works. I'm not sure what you mean by a requery after adding records. How would that be done?
 
After the save code, use me.requery. (or forms!formname.requery) This forces the query to run again, thus updating your form. You can read about it in the help.

Another useful one is "refresh".

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top