I am having problems converting the floowing code to ADO. Specifically with the FindFirst and Move.
I have serached but don't fully understand when to use "Seek" and when to use "Find" and also what options I have to include with them.
I have serached but don't fully understand when to use "Seek" and when to use "Find" and also what options I have to include with them.
Code:
Dim blnFound As Boolean
Dim lngWOIDSub As Long, lngWOID As Long, strSQL As String
Dim cnn As New ADODB.Connection
Dim rstItemsOrdrd As New ADODB.Recordset
Dim rstKitItems As New ADODB.Recordset
lngWOIDSub = Me.WOIDSub
lngWOID = Me.WOID
blnFound = False
strSQL = "SELECT [T_SetupSheetHistoryCombinationsDetail].ComboCustPartNum FROM [T_SetupSheetHistoryCombinationsDetail] " & _
"WHERE ((([T_SetupSheetHistoryCombinationsDetail].WOID)=" & lngWOID & ") AND " & _
"(([T_SetupSheetHistoryCombinationsDetail].WOIDSub)=" & lngWOIDSub & "));"
' Open the connection
cnn.Open CurrentProject.Connection
If rstItemsOrdrd.BOF = False Then
rstItemsOrdrd.MoveFirst
End If
Do Until rstItemsOrdrd.EOF = True
rstKitItems.[COLOR=Red]FindFirst[/COLOR] "[KitItemPartNum]=""" & rstItemsOrdrd.Fields(0) & """"
If rstKitItems.[COLOR=Red]NoMatch[/COLOR] = True Then
blnFound = True
Exit Do
End If
rstItemsOrdrd.[COLOR=Red]MoveNext[/COLOR]
Loop