I am having problems filtering a form: The following code, using Access2000, works on the first execution, but not after that, unless I initialize (close then open) the form or execute the ShowAllRecords command twice. The qury itself seems to work correctly but the previously filtered results get displayed again.
Private Sub cboAssignedTo_AfterUpdate()
Dim DB As Database, Q As QueryDef
Dim criteria As String, strSQL As String
Dim ctl As Control
Dim itm As Variant
Dim strDocName As String
strDocName = "_Jacksonville Action Register"
Set DB = CurrentDb()
Set Q = DB.QueryDefs("filterAssignedTo"
Q.SQL = " SELECT AR_Jcvl.*, * FROM AR_Jcvl WHERE (((AR_Jcvl.AssignedTo) Like [Forms]![_Jacksonville Action Register]![cboAssignedTo]))ORDER BY AR_Jcvl.AssignedTo;"
DoCmd.OpenForm strDocName, acViewNormal, "filterAssignedTo"
Exit Sub
End Sub
This code works using Access2002 running in Access2000 file format.
The only difference I see is that one is using MS Object Model 10.0 vesus 9.0. ANY SUGGESTIONS?????
Private Sub cboAssignedTo_AfterUpdate()
Dim DB As Database, Q As QueryDef
Dim criteria As String, strSQL As String
Dim ctl As Control
Dim itm As Variant
Dim strDocName As String
strDocName = "_Jacksonville Action Register"
Set DB = CurrentDb()
Set Q = DB.QueryDefs("filterAssignedTo"
Q.SQL = " SELECT AR_Jcvl.*, * FROM AR_Jcvl WHERE (((AR_Jcvl.AssignedTo) Like [Forms]![_Jacksonville Action Register]![cboAssignedTo]))ORDER BY AR_Jcvl.AssignedTo;"
DoCmd.OpenForm strDocName, acViewNormal, "filterAssignedTo"
Exit Sub
End Sub
This code works using Access2002 running in Access2000 file format.
The only difference I see is that one is using MS Object Model 10.0 vesus 9.0. ANY SUGGESTIONS?????