Thanks for the reply: I am not sure how to apply your
suggestion. I have attached the VB code that I am using
now in conjuction with the make table macros suggested
earlier.Can you review this and offer any suggestions
to use other variables in the comparison.
Option Compare Database
Function DoComparison()
FindMatchingSpecs
End Function
Sub FindMatchingSpecs()
Dim dbobject As Database
Dim NewPartInfoRs As Recordset
Dim StoresInfoRS As Recordset
Dim MatchPartsRS As Recordset
Dim NewTechSpec As String
Dim StoresTechSpec As String
Dim HoldNewPartSpec As String
Dim HoldMatchingPartSpec As String
Dim HoldMaterial As String
Dim HoldMFG As String
Dim strLeftAmount As String
Dim intLeftAmount As Integer
Dim HoldLeftStores As String
Dim HoldLeftNew As String
Dim strQuery As String
Dim strQuery2 As String
Dim strQuery3 As String
Dim strInsert As String
Dim msgboxresult As Long
Dim Message As String
Dim Title As String
Dim Default As Integer
Dim HoldCode As String
Dim SupplierCodeRs As Recordset
Dim Checknumber As String
Dim Starttime As String
Dim Endtime As String
Dim TotalTime As String
On Error GoTo DensErr_Handler
Set dbobject = CurrentDb
Message = "Enter the number of characters you would like to use in your comparison. Note** Comparison starts at left of the Field! A smaller number gives More Results but Less Accuracy" ' Set prompt.
Title = "Match String Input" ' Set title.
Default = "4" ' Set default.
' Display message, title, and default value.
strLeftAmount = InputBox(Message, Title, Default)
intLeftAmount = CInt(strLeftAmount)
strQuery = "SELECT * FROM TBLNewParts_NoMatch;"
strQuery2 = "SELECT * FROM tblallparts;"
strQuery3 = "SELECT * FROM MatchingParts;"
Set NewPartInfoRs = dbobject.OpenRecordset(strQuery)
Set StoresInfoRS = dbobject.OpenRecordset(strQuery2)
Set MatchPartsRS = dbobject.OpenRecordset(strQuery3)
With MatchPartsRS
.MoveFirst
Do While Not .EOF
.Delete
.MoveNext
Loop
End With
With NewPartInfoRs
.MoveFirst
Do While Not .EOF
'[Forms]![Switchboard]![txtCheckingPart] = .AbsolutePosition
Checknumber = "Checking Part Number---->>> " & Str(.AbsolutePosition)
DoCmd.Echo True, Checknumber
NewTechSpec = ""
NewTechSpec = .Fields("newparts_Technical Spec"

.Value
HoldLeftNew = Left(NewTechSpec, intLeftAmount)
'MsgBox NewTechSpec
With StoresInfoRS
.MoveFirst
Do While Not .EOF
StoresTechSpec = .Fields("Technical Spec"

.Value
HoldLeftStores = Left(StoresTechSpec, intLeftAmount)
'MsgBox (Left(.Fields("Technical Spec"

.Value, intLeftAmount))
'MsgBox (Left(NewTechSpec, intLeftAmount))
'Debug.Print HoldLeftStores, HoldLeftNew
If HoldLeftStores = HoldLeftNew Then
HoldNewPartSpec = NewTechSpec
HoldMatchingPartSpec = .Fields("Technical Spec"

.Value
HoldMaterial = .Fields("Material"

.Value
HoldMFG = .Fields("MFG"

.Value
With MatchPartsRS
.AddNew
.Fields("NewPartSpec"

.Value = HoldNewPartSpec
.Fields("MatchingSpec"

.Value = HoldMatchingPartSpec
.Fields("Material"

.Value = HoldMaterial
.Fields("MFG"

.Value = HoldMFG
.Update
End With
End If
.MoveNext
Loop
End With
.MoveNext
Loop
End With
Exit Sub