S
SEAN DI''''ANNO
Dim Td1 As TableDef
Dim QD1 As QueryDef
Dim NewRule As Long
Dim ListCriteria As Variant
Dim RS3 As Recordset
Set db = CurrentDb()
Set Td1 = db.TableDefs!tblListItems
Set RS3 = Td1.OpenRecordset
Please..can some one help,
This piece of code is meant to delete an item from a table called
tblListItems dependant on the value of ListOfItems (ListBox)
It used to work...Now I keep on getting the above error on RS3.FindFirst
ListCriteria
WHat am I doing wrong??
With Me.ListOfItems
For DeleteLoop = 0 To Me.ListOfItems.ListCount - 1
DeleteItem = Me.ListOfItems.Column(0, DeleteLoop)
ListCriteria = "RuleLink like " & Me.RuleIdentifier.Value
RS3.MoveFirst
RS3.FindFirst ListCriteria
DeletePoint:
If Me.ListOfItems.Selected(DeleteLoop) Then
If RS3!RuleValue = DeleteItem Then
RS3.Delete
GoTo ExitDelete
Else
RS3.MoveNext
GoTo DeletePoint
End If
End If
Next DeleteLoop
End With
Dim QD1 As QueryDef
Dim NewRule As Long
Dim ListCriteria As Variant
Dim RS3 As Recordset
Set db = CurrentDb()
Set Td1 = db.TableDefs!tblListItems
Set RS3 = Td1.OpenRecordset
Please..can some one help,
This piece of code is meant to delete an item from a table called
tblListItems dependant on the value of ListOfItems (ListBox)
It used to work...Now I keep on getting the above error on RS3.FindFirst
ListCriteria
WHat am I doing wrong??
With Me.ListOfItems
For DeleteLoop = 0 To Me.ListOfItems.ListCount - 1
DeleteItem = Me.ListOfItems.Column(0, DeleteLoop)
ListCriteria = "RuleLink like " & Me.RuleIdentifier.Value
RS3.MoveFirst
RS3.FindFirst ListCriteria
DeletePoint:
If Me.ListOfItems.Selected(DeleteLoop) Then
If RS3!RuleValue = DeleteItem Then
RS3.Delete
GoTo ExitDelete
Else
RS3.MoveNext
GoTo DeletePoint
End If
End If
Next DeleteLoop
End With