When I run this code I would expect each field to be assigned the value 1.
Instead, the first record's VOC-lbs is assigned 1. The second record is assigned 2. The third record is assigned 3 and so on.
I have tried batch update and regular update.
How do I fix this?
Thanks in advance.
Instead, the first record's VOC-lbs is assigned 1. The second record is assigned 2. The third record is assigned 3 and so on.
I have tried batch update and regular update.
How do I fix this?
Thanks in advance.
Code:
Dim rst As ADODB.Recordset
Dim Calc_Value As Single
Set rst = New ADODB.Recordset
With rst
Set .ActiveConnection = CurrentProject.Connection
.Source = "EquipmentUsage"
.CursorLocation = adUseClient
.LockType = adLockBatchOptimistic
.CursorType = adOpenKeyset
.Open
.MoveFirst
Do While Not .EOF
Calc_Value = 1
.Fields("VOC_Lbs") = Calc_Value
.MoveNext
Loop
.UpdateBatch
End With
rst.Close
Set rst = Nothing