S
Sash
I'm creating a tab delimited file based on 3 different record sets. The NT
table contains notes and there may be 0 notes or 10 notes for each account.
I set DebtID earlier in the program based on my first record set and then
analyze the data accordingly. This works perfectly for what I'm trying to
do, but takes FOREVER to run because the NT table has 65000+ records, so each
time I look at an account it's looking at each record. I'm sure there's a
better way to do this....maybe set my record set where it's equal to DebtID?
As always, any assistance would be greatly appreciated!
Recordset Selection:
Set rs3 = db.OpenRecordset(strSQL3, dbOpenDynaset, dbSeeChanges)
If Statement:
If DebtID >= 100109 Then
rs1.MoveFirst
Do While Not rs1.EOF
If rs1.Fields("Debtor_ID") = DebtID Then
NT = "NT" & Chr(9) & rs1.Fields("NoteDate") & Chr(9) & rs1.Fields("NoteText")
Print #1, NT
rs1.MoveNext
Else
rs1.MoveNext
End If
Loop
End If
table contains notes and there may be 0 notes or 10 notes for each account.
I set DebtID earlier in the program based on my first record set and then
analyze the data accordingly. This works perfectly for what I'm trying to
do, but takes FOREVER to run because the NT table has 65000+ records, so each
time I look at an account it's looking at each record. I'm sure there's a
better way to do this....maybe set my record set where it's equal to DebtID?
As always, any assistance would be greatly appreciated!
Recordset Selection:
Set rs3 = db.OpenRecordset(strSQL3, dbOpenDynaset, dbSeeChanges)
If Statement:
If DebtID >= 100109 Then
rs1.MoveFirst
Do While Not rs1.EOF
If rs1.Fields("Debtor_ID") = DebtID Then
NT = "NT" & Chr(9) & rs1.Fields("NoteDate") & Chr(9) & rs1.Fields("NoteText")
Print #1, NT
rs1.MoveNext
Else
rs1.MoveNext
End If
Loop
End If