Problem with updating recordset

Hi,

I‘m trying to get a function to update each row with in a recordset.  So far I have this:

Dim myRST As Recordset
Set myRST = GetADORecordset("SELECT running_requirement FROM T6 WHERE identifier = '" & NewIssueAss & "' ")
MsgBox ("myRST.RecordCount - " & myRST.RecordCount)
myRST.MoveFirst
Do While Not myRST.EOF
myRST.Fields("running_requirement") = myDLookUp("original_requirement", "T6", "identifier = '" & NewIssueAss & "' ")
myRST.Update
myRST.MoveNext
Loop

The function GetADORecordset returns a recordset with 3 rows in it which is correct.  However the update portion is not updating any of the records.

The locktype of the recordset is    rst.LockType = adLockOptimistic if that makes any difference.

I’ve also tried myRST.UpdateBatch but it yields the same results.

Any pointers appreciated.

Thanks.
andyw27Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Helen FeddemaCommented:
What is myDLookup?  Or is this a typo for DLookup?  What is NewIssueAss, and where is it set?  It may be helpful to set variables of the appropriate data type, and set them with the values you need to use in code, so you can examine them in the Immediate Window.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
andyw27Author Commented:
Here is the myDLookup function:

Public Function myDLookUp(ByVal strField As String, ByVal strDomain As String, _
    Optional strCriteria As Variant)

    Dim rsLk As Recordset
    Dim strSql As String
   
    myDLookUp = Null
    If Not IsMissing(strCriteria) Then
        strSql = "SELECT " & strField & " FROM " & strDomain & " WHERE " & strCriteria
    Else
        strSql = "SELECT " & strField & " FROM " & strDomain
    End If
    Set rsLk = GetADORecordset(strSql)
    If Not rsLk.EOF Then myDLookUp = rsLk(0) Else myDLookUp = "N/A"
    rsLk.Close

End Function

NewIssueAss is a string which is set before I call this function.  The field runing_requirement is number field.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.