Below is my code to cycle thru the records in the subform and look for values that need updating.
The problem is it I get a no current record error after it updates the field value. I have marked the line of code it hangs on. Any thoughts??
Code:
Private Sub Form_Current()
Dim rst As Recordset
Dim fld As Field
Dim response As Integer
Dim controll As Control
Dim cur As Currency
Set rst = Me.Form.Recordset
While Not rst.EOF
For Each fld In rst.Fields
If fld.Name = "Part_Qty" Then
cur = fld.Value * Me.Part.Column(5) 'this where it hangs
End If
If fld.Name = "Total_Part_Cost" Then
If cur <> fld.Value Then
response = MsgBox("Value needs updating. Would you like to Update?", vbYesNo)
If response = 6 Then
MsgBox ("Updating....")
Me.Total_Part_Cost = cur
Me.Total_Part_Cost.Requery
End If
End If
End If
Next
rst.MoveNext
Wend
End Sub