98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access VBA Training and help » References to DB fields in If statement not working
References to DB fields in If statement not working
Resolved · Medium Priority · Version 2003
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.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Combo box for finding recordsYou can use a combo box in a form to look up a record. If you place the comb box in the Form header, by then selcting they a field type from the drop down loist, you will see the record for it |