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

Save a form filter as a query

Status
Not open for further replies.

MartyBoy

Technical User
Joined
Aug 20, 2003
Messages
41
Location
NZ
Hi
I need to allow users to filter records using the "Query by Form" function and then to programatically save the filter that the user creates as a Query. This is to allow another form to use the saved Query to select the records for another function.

I know this is easily achieved using the "Save as Query" function in "Advanced Filter", but I don't want users to have to use the MS toolbars and menu options. I want to be able to create the saved Query automatically as soon as the form filter is run.

Can anyone please assist with the code required to achieve this?

I know that it is possible to do this because MS tells me so, but I cannot find any refernce code anywhere relating to saving a filter as a query.

(Sorry for the length of this thread):-(
 
From msn Knowledge
Note You can save a filter as a query by clicking Save As Query on the File menu while in the Filter By Form window or the Advanced Filter/Sort window.



Hope this helps
Hymn
 
Not completely clear what you want. But could you take advantage of Me.filter from the first form. It could be saved in a public variable, and then either open the second form using the filter as a parameter or set a function to return that public variable and use that as a filter on the second form.
Alternatively you could save the filter in a table withe the option to record some sort of decsription and then have a drop-down box in the second form to select the appropriate filter.
Any use?
Simon Rouse
 
Oops
not awake when i made a mess of answering earlier
If your trying to do away with MS Access toolbars
would'nt it be easier to use a search engine to do your filtering
This seems to be one of the best examples at the thread below
Thread702-563930

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top