J
Job via AccessMonster.com
Hi, I have an old problem.
I have a form (frmDic) that he contains a list box (lstDic) with 4 columns
(Code, Port, Eng and Esp) based in a query (qryDic). I would like to erase a
selected register using a button (Exclude).
I have the following code:
Private Sub cmdExclude_Click()
Dim MySet As Recordset, varItem As Variant
Set MySet = CurrentDb.OpenRecordset("qryDic", dbOpenDynaset)
With Me.lstDic
For Each varItem In .ItemsSelected
With MySet
.FindFirst "Code='" & Me.lstDic.ItemsSelected(varItem).Column
(0) & "'"
If .NoMatch = False Then
.Delete
End If
End With
Next varItem
End With
MySet.Close
Set MySet = Nothing
Me.Requery
End Sub
This code cause the following error of compilation: "Invalid qualifier."
referring the "ItemsSelected".
Somebody can help me?
Thanks.
Jorge Barreto
I have a form (frmDic) that he contains a list box (lstDic) with 4 columns
(Code, Port, Eng and Esp) based in a query (qryDic). I would like to erase a
selected register using a button (Exclude).
I have the following code:
Private Sub cmdExclude_Click()
Dim MySet As Recordset, varItem As Variant
Set MySet = CurrentDb.OpenRecordset("qryDic", dbOpenDynaset)
With Me.lstDic
For Each varItem In .ItemsSelected
With MySet
.FindFirst "Code='" & Me.lstDic.ItemsSelected(varItem).Column
(0) & "'"
If .NoMatch = False Then
.Delete
End If
End With
Next varItem
End With
MySet.Close
Set MySet = Nothing
Me.Requery
End Sub
This code cause the following error of compilation: "Invalid qualifier."
referring the "ItemsSelected".
Somebody can help me?
Thanks.
Jorge Barreto