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

filter query upon opening? 1

Status
Not open for further replies.

chestyxbond

Technical User
Oct 1, 2001
18
US


I can't figure out how to do this... do queries even have on open properties? How do you get to them in Access 97?

Daniel
 
I don't believe they do. Queries are simply SQL statements which display or update data. What are you trying to accomplish? Maq B-)
<insert witty signature here>
 

I have a form that contains data files that are populated from a query. I'd like to have the form be populated only with filtered records, but I can't figure out how to get the filter to be applied automatically. What about putting an apply filter action in the second form's code? For instance, this is the line that opens the query:

Set rst = db.OpenRecordset(&quot;multifamily&quot;)

Is there a way to augment that line so that it displays filtered records only?
 
All you need to do is set the recordsource property of the form to the query.

How is the form being opened? Is it called from another form or macro? If so you can enter your filter criteria in the docmd.openform statement.

Is the filter always the same filter each time you open the form? If so then just enter the filter as part of the query's selection criteria. Maq B-)
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top