Simon has attended:
No courses
References to DB fields in If statement not working
I've got the following code in a module that deletes data. I've stepped through this and even when both parts of the IF are true the code steps over the delete statement (jumping straight to the endif).
With rstDBTarget
.MoveFirst
Do While Not .EOF
If .Fields("VolID") = iVolID AND _
.Fields("ReqID") = Me.ReqID Then
Debug.Print "Deleted one"
.Delete
.Update
End If
End If
.MoveNext
Loop
End With
Is there a problem with referring directly to the rst fields in the IF clause?
Thanks.