Want to read field1 in a raw data query (rst) and create another table/query (tsr) based on field1 content. I get the LINEID field written to the new table to start the record but the Update_prod: sub fails with a "NO CURRENT RECORD" message leaving the PROD1 field blank. Three fields in new table: LINEID, PROD1, SOFT1. Each time field1 ="LineID", create new record and fill in 3 fields.
'open query-cnf-raw, read field1, build query-cnf-scrub records/fields based on field1 content
Dim rst As DAO.Recordset
Dim tsr As DAO.Recordset
Dim dbs As DAO.database
Set dbs = CurrentDb
Set rst = dbs.openrecordset("query-cnf-raw", dbopendynaset)
Set tsr = dbs.openrecordset("query-cnf-scrub", dbopendynaset)
Do While Not rst.EOF
rst.Edit
id_update:
If Left(rst!field1, 4) = "Line" Then GoTo update_id
If Left(rst!field1, 7) = "prodnam" Then GoTo Update_prod
If Left(rst!field1, 7) = "softdld" Then GoTo Update_soft
'End If
Continue:
rst.MoveNext
Loop
Exit Sub
update_id:
tsr.AddNew
tsr!LineID = Mid(rst!field1, 10, 8)
tsr.Update
GoTo Continue
Update_prod:
tsr.Edit
tsr!prod1 = Mid(rst!field1, 11, 22)
tsr.Update
GoTo Continue
Update_soft:
tsr.Edit
tsr!soft1 = Mid(rst!field1, 14, 22)
tsr.Update
GoTo Continue
End Sub



