The following code works on PC with WinXP/OfficeXP - Access using Access2000 file format:
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
On another system using WinNT and Access2000, this code works on the first execution, but not after that, unless I initialize the form a or ShowAllRecords twice.
The only difference I see is that one is using MS Object Model 10.0 vesus 9.0
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
On another system using WinNT and Access2000, this code works on the first execution, but not after that, unless I initialize the form a or ShowAllRecords twice.
The only difference I see is that one is using MS Object Model 10.0 vesus 9.0