I'm having a problem opening a form that relies on a query as a control source. I keep getting the error saying that the query doesn't exist, so I wrote the following code to see if it actually does...
For Each Qry In thisdb.AllQueries
If Qry.Name = "qryResults" Then
If Qry.IsLoaded Then
DoCmd.Close acQuery, "qryResults", acSaveNo
End If
MsgBox "found it"
End If
Next
DoCmd.OpenForm "frmViewResults2"
It brings up the msgbox so it definately finds it, however the form still won't open. Is there a way I can refresh things so access realises the query exists and opens the form?
thanks for any help
For Each Qry In thisdb.AllQueries
If Qry.Name = "qryResults" Then
If Qry.IsLoaded Then
DoCmd.Close acQuery, "qryResults", acSaveNo
End If
MsgBox "found it"
End If
Next
DoCmd.OpenForm "frmViewResults2"
It brings up the msgbox so it definately finds it, however the form still won't open. Is there a way I can refresh things so access realises the query exists and opens the form?
thanks for any help