B
Beetle
I'm sure I'm missing something simple here, but I'm just not seeing it
right now.
A2003. I have a form which uses a query as it's recordset. I have a command
button on the form that resorts the records when clicked. The code all works
fine except that the form won't requery. The stored query gets the new SQL
an if I open it directly it shows the correct results, but the form won't
show the
new query records until I close and reopen it, even with Me.Requery in the
code.
Code (example) is as follows;
Dim strSQL As String
Dim qdf As QueryDef
strSQL = "blah blah blah a bunch of SQL"
set qdf = Currentdb.QueryDefs ("qryCustomerSort")
qdf.SQL = strSQL
Me.Requery '<<< this doesn't work
qdf.Close
Set qdf = Nothing
Like I said, I'm probably missing something completely obvious, but so far
all I'm getting is bruises on my forehead.
Any ideas?
right now.
A2003. I have a form which uses a query as it's recordset. I have a command
button on the form that resorts the records when clicked. The code all works
fine except that the form won't requery. The stored query gets the new SQL
an if I open it directly it shows the correct results, but the form won't
show the
new query records until I close and reopen it, even with Me.Requery in the
code.
Code (example) is as follows;
Dim strSQL As String
Dim qdf As QueryDef
strSQL = "blah blah blah a bunch of SQL"
set qdf = Currentdb.QueryDefs ("qryCustomerSort")
qdf.SQL = strSQL
Me.Requery '<<< this doesn't work
qdf.Close
Set qdf = Nothing
Like I said, I'm probably missing something completely obvious, but so far
all I'm getting is bruises on my forehead.
Any ideas?