I have two list boxes. The one on the left has some values and if I want to use the values i moves them to the right. Well it works sometimes and sometimes I get this error: Either BOF or EOF is true or the current record has been deleted and in my code it says EOF=true. Help
here is the code
Dim conn As ADODB.Connection
Dim MyRS As ADODB.Recordset
Dim SelItem As Control
Set SelItem = Me.ListYes
If IsNull(SelItem) Then
MsgBox "Please select an item from the list"
Else
Set conn = CurrentProject.Connection
Set MyRS = New ADODB.Recordset
MyRS.Open "tbl_CompTaskAssignment", conn, adOpenDynamic, adLockOptimistic
With MyRS
.Find "DefaultTaskID = '" & SelItem & "'"
.Fields("YesNo").Value = "No"
.Update
End With
Set MyRS = Nothing
Set conn = Nothing
Me.ListYes.Requery
Me.ListNo.Requery
End If
here is the code
Dim conn As ADODB.Connection
Dim MyRS As ADODB.Recordset
Dim SelItem As Control
Set SelItem = Me.ListYes
If IsNull(SelItem) Then
MsgBox "Please select an item from the list"
Else
Set conn = CurrentProject.Connection
Set MyRS = New ADODB.Recordset
MyRS.Open "tbl_CompTaskAssignment", conn, adOpenDynamic, adLockOptimistic
With MyRS
.Find "DefaultTaskID = '" & SelItem & "'"
.Fields("YesNo").Value = "No"
.Update
End With
Set MyRS = Nothing
Set conn = Nothing
Me.ListYes.Requery
Me.ListNo.Requery
End If