Hello -
I have a form which calculates and stores a cost into a field through the 'on current' event of the form. I used code which cycles through my recordset on the click of a button and updates the entire recordset when clicked.
The code runs but doesn't seem to alot enough time to allow the 'on current' event to run and store the number I need as it hits each record.
Is there something i can add to the code to make it pause a second or two or enough time to run the code on each of my records?
the code on the button is:
Dim TotalRecordsTemp As Integer
Dim rst As Object
Set rst = Me.RecordsetClone
On Error Resume Next
rst.MoveLast
On Error GoTo 0
TotalRecordsTemp = rst.RecordCount
For i = 1 To TotalRecordsTemp
DoCmd.GoToRecord , , acNext
Next i
MsgBox "Standard Cost update is complete!", vbOKOnly
DoCmd.Close
thanks for any suggestions
Brian
I have a form which calculates and stores a cost into a field through the 'on current' event of the form. I used code which cycles through my recordset on the click of a button and updates the entire recordset when clicked.
The code runs but doesn't seem to alot enough time to allow the 'on current' event to run and store the number I need as it hits each record.
Is there something i can add to the code to make it pause a second or two or enough time to run the code on each of my records?
the code on the button is:
Dim TotalRecordsTemp As Integer
Dim rst As Object
Set rst = Me.RecordsetClone
On Error Resume Next
rst.MoveLast
On Error GoTo 0
TotalRecordsTemp = rst.RecordCount
For i = 1 To TotalRecordsTemp
DoCmd.GoToRecord , , acNext
Next i
MsgBox "Standard Cost update is complete!", vbOKOnly
DoCmd.Close
thanks for any suggestions
Brian