B
Bill Parker
I am using a form (frmSearchAlpha) that uses as its structure Allen Browne's
Very Excellent filter code. The filter works great, and we have been using
it for some time. We take the filter and use it in a VB SQL statement to
append the filter results to another table (tblRetrievalVest) The problem is
we are now filtering almost 500,000 records. The filtering doesn't take a
long time, particularly after the first search, but the append SQL is
beginning to. Is there code that allows us to append directly from the
filter results instead running the filter all over again in the SQL?
Here is the code we are using now:
Private Sub Command69_Click()
If Me.FilterOn = True Then
Dim strAdd As String
strAdd = "INSERT INTO tblRetrievalVest ( ID, DOB, [Exam Year], Notes,
[Job#], [Box#], [Rec Pos], [Volume#], Name, MRN, OrgID, Accession )SELECT
tblAlpha.ID, tblAlpha.DOB, tblAlpha.[Exam Year], tblAlpha.Notes,
tblAlpha.[Job#], tblAlpha.[Box#], tblAlpha.[Rec Pos], tblAlpha.[Volume#],
tblAlpha.Name, tblAlpha.MRN, tblAlpha.OrgID, tblAlpha.Accession From TBLALPHA
WHERE " & Me.Filter
End If
Call Command78_Click
Me.ChooseJob = Null
DoCmd.RunSQL strAdd
Me.Filter = "(False)"
Me.FilterOn = True
End Sub
As always, thank you for your kind consideration in advance,
Bill
Very Excellent filter code. The filter works great, and we have been using
it for some time. We take the filter and use it in a VB SQL statement to
append the filter results to another table (tblRetrievalVest) The problem is
we are now filtering almost 500,000 records. The filtering doesn't take a
long time, particularly after the first search, but the append SQL is
beginning to. Is there code that allows us to append directly from the
filter results instead running the filter all over again in the SQL?
Here is the code we are using now:
Private Sub Command69_Click()
If Me.FilterOn = True Then
Dim strAdd As String
strAdd = "INSERT INTO tblRetrievalVest ( ID, DOB, [Exam Year], Notes,
[Job#], [Box#], [Rec Pos], [Volume#], Name, MRN, OrgID, Accession )SELECT
tblAlpha.ID, tblAlpha.DOB, tblAlpha.[Exam Year], tblAlpha.Notes,
tblAlpha.[Job#], tblAlpha.[Box#], tblAlpha.[Rec Pos], tblAlpha.[Volume#],
tblAlpha.Name, tblAlpha.MRN, tblAlpha.OrgID, tblAlpha.Accession From TBLALPHA
WHERE " & Me.Filter
End If
Call Command78_Click
Me.ChooseJob = Null
DoCmd.RunSQL strAdd
Me.Filter = "(False)"
Me.FilterOn = True
End Sub
As always, thank you for your kind consideration in advance,
Bill