' executar gravar itens do subform
gSQL = "SELECT ID_OC,AND_TEXTO,AND_TEMPO,AND_STATUS,DHCAD,USERLOG"
gSQL = gSQL & " FROM TSER_OCAND_TEMP"
Set gDB = CurrentDb
Set gRST = gDB.OpenRecordset(gSQL, dbOpenDynaset, dbSeeChanges)
gRST.MoveFirst
Do While Not gRST.EOF
gSQL = "INSERT INTO TSER_OCAND"
gSQL = gSQL & " ID_OC = '" & Me.ID & "',"
gSQL = gSQL & " AND_TEXTO = '" & gRST!AND_TEXTO & "',"
gSQL = gSQL & " AND_STATUS = '" & gRST!AND_STATUS & "',"
gSQL = gSQL & " AND_TEMPO = '" & gRST!AND_TEMPO & "',"
gSQL = gSQL & " DHCAD = '" & gRST!DHCAD & "',"
gSQL = gSQL & " USERLOG = '" & gRST!USERLOG & "'"
gDB.Execute gSQL, dbSeeChanges
gRST.MoveNext
Loop
gRST.Close
Set gRST = Nothing
MsgBox "inserção: Rows insert affeted, " & gDB.RecordsAffected
gSQL = "SELECT ID_OC,AND_TEXTO,AND_TEMPO,AND_STATUS,DHCAD,USERLOG"
gSQL = gSQL & " FROM TSER_OCAND_TEMP"
Set gDB = CurrentDb
Set gRST = gDB.OpenRecordset(gSQL, dbOpenDynaset, dbSeeChanges)
gRST.MoveFirst
Do While Not gRST.EOF
gSQL = "INSERT INTO TSER_OCAND"
gSQL = gSQL & " ID_OC = '" & Me.ID & "',"
gSQL = gSQL & " AND_TEXTO = '" & gRST!AND_TEXTO & "',"
gSQL = gSQL & " AND_STATUS = '" & gRST!AND_STATUS & "',"
gSQL = gSQL & " AND_TEMPO = '" & gRST!AND_TEMPO & "',"
gSQL = gSQL & " DHCAD = '" & gRST!DHCAD & "',"
gSQL = gSQL & " USERLOG = '" & gRST!USERLOG & "'"
gDB.Execute gSQL, dbSeeChanges
gRST.MoveNext
Loop
gRST.Close
Set gRST = Nothing
MsgBox "inserção: Rows insert affeted, " & gDB.RecordsAffected