Hi,
I've never written a program with this many records before and the time it takes to process is through the roof.
I have 1 table with 5,000 records and another table with 160,000.
What I need to do is loop through the 160,000 and update the 5,000 accordingly.
Essentially my code looks like this:
dim Trans as recordset
Set Traans = currentdb.openrecordset("table1",db_open_dynaset)
dim Recon as recordset
set Recon = currentdb.openrecordset("table2",db_open_dynaset)
If Trans.EOF = False Then
Trans.MoveFirst
Do Until Trans.EOF
Recon.FindFirst "criteria = '" & Trans!field & "' AND criteria2 = '" & Trans!field2 & "'"
If Recon.NoMatch Then
With Recon
.AddNew
.update
End With
Else
With Recon
.edit
.update
End With
End If
End If
Is there any way I can make this run faster or more efficiently? Thanks.
I've never written a program with this many records before and the time it takes to process is through the roof.
I have 1 table with 5,000 records and another table with 160,000.
What I need to do is loop through the 160,000 and update the 5,000 accordingly.
Essentially my code looks like this:
dim Trans as recordset
Set Traans = currentdb.openrecordset("table1",db_open_dynaset)
dim Recon as recordset
set Recon = currentdb.openrecordset("table2",db_open_dynaset)
If Trans.EOF = False Then
Trans.MoveFirst
Do Until Trans.EOF
Recon.FindFirst "criteria = '" & Trans!field & "' AND criteria2 = '" & Trans!field2 & "'"
If Recon.NoMatch Then
With Recon
.AddNew
.update
End With
Else
With Recon
.edit
.update
End With
End If
End If
Is there any way I can make this run faster or more efficiently? Thanks.