T
tony
hi
after a user selected one or more item from a listbox, i click on a button
and i run this code
Private Sub cmdRecherche_Click()
Dim strIN As String
For Each Item In Me.lstTransit.ItemsSelected
strIN = strIN & "'" &
Me.lstTransit.ItemData(Item) & "',"
Next
strWhere = " where transit in (" & Left(strIN,
Len(strIN) - 1) & ")"
lblDGA.Caption = strWhere
Dim strQuery As String
strQuery = "select * from test3 " + strWhere
Set qd = CurrentDb.Querydefs("qry1")
qd.SQL = strQuery
qd.Close
DoCmd.OpenQuery "qry1"
End Sub
i get
error 3265
item not found in this collection
any idea?
table test3 exist....
after a user selected one or more item from a listbox, i click on a button
and i run this code
Private Sub cmdRecherche_Click()
Dim strIN As String
For Each Item In Me.lstTransit.ItemsSelected
strIN = strIN & "'" &
Me.lstTransit.ItemData(Item) & "',"
Next
strWhere = " where transit in (" & Left(strIN,
Len(strIN) - 1) & ")"
lblDGA.Caption = strWhere
Dim strQuery As String
strQuery = "select * from test3 " + strWhere
Set qd = CurrentDb.Querydefs("qry1")
qd.SQL = strQuery
qd.Close
DoCmd.OpenQuery "qry1"
End Sub
i get
error 3265
item not found in this collection
any idea?
table test3 exist....