Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
rs1.Open "表1", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs2.Open "表2", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs3.Open "表3", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Do Until rs1.EOF
cfjl = 0
Do Until rs2.EOF
If rs1!字段1 & rs1!字段2 & rs1!字段2 & rs1!字段3 & rs1!字段4 & rs1!字段5 & rs1!字段6 & rs1!字段7 & rs1!字段8 & rs1!字段9 & rs1!字段10 & rs1!字段11 & rs1!字段12 & rs1!字段13 & rs1!字段14 = rs2!字段1 & rs2!字段2 & rs2!字段2 & rs2!字段3 & rs2!字段4 & rs2!字段5 & rs2!字段6 & rs2!字段7 & rs2!字段8 & rs2!字段9 & rs2!字段10 & rs2!字段11 & rs2!字段12 & rs2!字段13 & rs2!字段14 Then
cfjl = -1
End If
rs2.MoveNext
Loop
If cfjl = 0 Then
rs3.AddNew
rs3![字段1] = rs1![字段1]
rs3![字段2] = rs1![字段2]
rs3![字段12] = rs1![字段12]
rs3.Update
End If
rs1.MoveNext
rs2.MoveFirst
Loop
rs1.Close
rs2.Close
rs3.Close