G Guest Oct 23, 2004 #1 Is there any way to capture in code the name and parameters of the query saved when a user saves a filter using filter by form?
Is there any way to capture in code the name and parameters of the query saved when a user saves a filter using filter by form?
A Allen Browne Oct 24, 2004 #2 Read the Filter property of the form, e.g.: Dim strWhere As String If Me.FilterOn Then strWhere = Me.Filter End If From there, you have to parse the text out. Note that the form's Filter may contain values from lookup tables that are not in the RecordSource of the form.
Read the Filter property of the form, e.g.: Dim strWhere As String If Me.FilterOn Then strWhere = Me.Filter End If From there, you have to parse the text out. Note that the form's Filter may contain values from lookup tables that are not in the RecordSource of the form.
G Guest Oct 24, 2004 #3 This is helpful but I'd like to capture both the recordset and filter to create my own query in code.
This is helpful but I'd like to capture both the recordset and filter to create my own query in code.
A Allen Browne Oct 24, 2004 #4 What is the RecordSource of the query? - A table or query? You need: "SELECT * FROM MyTable WHERE " & strWhere & ";" - a SQL statement? You need to parse it get the WHERE clause, and AND the filter.
What is the RecordSource of the query? - A table or query? You need: "SELECT * FROM MyTable WHERE " & strWhere & ";" - a SQL statement? You need to parse it get the WHERE clause, and AND the filter.
G Guest Oct 24, 2004 #5 It's an SQL statement I set up using data from 3 tables. I figured out that all I probably need to do is use the filter as the Where statement on my new query. It finally dawned on me. Thanks.
It's an SQL statement I set up using data from 3 tables. I figured out that all I probably need to do is use the filter as the Where statement on my new query. It finally dawned on me. Thanks.