• Intermittant code failure

    Author
    Topic
    #1774048

    I have this block of code that seems to fail about 1 in 20 times

    Code:
        Set rst3 = CurrentDb.OpenRecordset(“tblItemsDD”)
        For Each varItem In Me.lstList.ItemsSelected
            With rst3
                .MoveFirst
                .FindFirst “[ItemID]=” & Me.lstList.Column(0, varItem)
                If Not .NoMatch Then
                .Edit
     >>>>>  !ItemCost = InputBox(“Enter per Item Cost”, “Item Value”) <<<<<<<
                .Update
                End If
            End With
        Next varItem
        
        Me.lstList.Requery
    

    The marked line normally works fine but every now and then the record refuses to update.
    If it fails the first time, it will fail consistently and I have to open the table and update the field manually to get the rest of the form code to run.
    So it seems to be record specific.

    Any thoughts would be most appreciated

    Reply To: Intermittant code failure

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: