G
Guest
I have a query for my recordsource then on my form I have the user select
different filter options. I modify the query using
Dim dbs As Database
Dim qdf As QueryDef
Set dbs as CurrentDb
Set qdf = dbs.QueryDefs("Query1")
<Bunch of Filtering Code in Here>
qdf.SQL = "Insert New SQL Statement Here"
Me.Requery
Me.Requery
qdf.Close
When I change the SQL statement, the statements themselves work but I need
to close the form and open it again in order for the filter to work. I've
tried using Me.Refresh and I've tried putting the Me.Requery after the
qdf.Close. It didn't work.
I've tried altering the Recordsource before using Me.Recordsource = "Insert
New SQL Statement Here" and it works great. I can't use it this time because
the SQL statement is too long.
How can I reload the query in the form without closing the form?
Thanks,
Can
reload query in form
different filter options. I modify the query using
Dim dbs As Database
Dim qdf As QueryDef
Set dbs as CurrentDb
Set qdf = dbs.QueryDefs("Query1")
<Bunch of Filtering Code in Here>
qdf.SQL = "Insert New SQL Statement Here"
Me.Requery
Me.Requery
qdf.Close
When I change the SQL statement, the statements themselves work but I need
to close the form and open it again in order for the filter to work. I've
tried using Me.Refresh and I've tried putting the Me.Requery after the
qdf.Close. It didn't work.
I've tried altering the Recordsource before using Me.Recordsource = "Insert
New SQL Statement Here" and it works great. I can't use it this time because
the SQL statement is too long.
How can I reload the query in the form without closing the form?
Thanks,
Can
reload query in form