So I have the below code and when it runs instead of rs getting one record ("Streamlined Communications - Automated") It appears the RS is getting everything in the table. When I ran the first "Do While" loop it updated the very last record in the table which was "Forecast Accuracy"...
Code:
vMetricName = "Streamlined Communications - Automated"
mySQL = "SELECT * FROM RAW_Data WHERE [MetricName] = '" & vMetricName & "';"
Set rs = db.OpenRecordset(mySQL, dbOpenDynaset)
rs.MoveLast
rs.MoveFirst
i = 0
Do While Not rs.EOF
For Each fld In rs.Fields
i = i + 1
If IsNull(fld.Value) Then
rs1.Edit
rs1("FiscMonth" & i).Value = vPctAuto
rs1.Update
rs.MoveLast
Exit For
End If
Next fld
rs.MoveNext
Loop