Private Sub Command0_Click()
Dim con As New ADODB.Connection
Dim rec As New ADODB.Recordset
Dim recc As New ADODB.Recordset
Dim i As Integer
Set con = CurrentProject.Connection
rec.Open "表1", con, adOpenKeyset, adLockOptimistic
recc.Open "表2", con, adOpenKeyset, adLockOptimistic
rec.MoveFirst
i = 1
Do While Not rec.EOF
If rec!字段1 = recc!字段1 Then
Do While Not recc.EOF
recc!字段2 = recc!字段1 * 100 + i
i = i + 1
recc.MoveNext
Loop
End If
recc.Close
Set recc = Nothing
rec.MoveNext
Loop
rec.Close
Set rec = Nothing
End Sub
[attach]38821[/attach]