M
Maracay
Hi guys, there is a better way to do this routine, I need to read a table
(.rsa) and compare the right and left of all the fields of this table with
another table (.rsj)
Example:
The word “Manager†I need to look for this word at the end and beginning of
each field of each record.
Sales Manager
Manager
Manager of Department
My question is the Do until cycle is the only option to do this kind of
search, 1 record at a time or there is a better way?.
Thank
Se the code, (the code is longer, has another searches, hopefully I didn’t
miss anything)
If rsa.RecordCount > 0 Then
Do Until rsa.EOF
For Each fld In rsa.Fields
rsj.MoveFirst
Do Until rsj.EOF
If rsj!Title = Left(fld.Value, Len(rsj!Title)) Or rsj!Title
= Right(fld.Value, Len(rsj!Title)) Then
rsc.AddNew
rsc!StatisticTitle = fld.Name
rsc!nCountTitle = 1
rsc.Update
Exit Do
End If
rsj.MoveNext
Loop
Next
rsa.MoveNext
Loop
End If
MsgBox "Done"
(.rsa) and compare the right and left of all the fields of this table with
another table (.rsj)
Example:
The word “Manager†I need to look for this word at the end and beginning of
each field of each record.
Sales Manager
Manager
Manager of Department
My question is the Do until cycle is the only option to do this kind of
search, 1 record at a time or there is a better way?.
Thank
Se the code, (the code is longer, has another searches, hopefully I didn’t
miss anything)
If rsa.RecordCount > 0 Then
Do Until rsa.EOF
For Each fld In rsa.Fields
rsj.MoveFirst
Do Until rsj.EOF
If rsj!Title = Left(fld.Value, Len(rsj!Title)) Or rsj!Title
= Right(fld.Value, Len(rsj!Title)) Then
rsc.AddNew
rsc!StatisticTitle = fld.Name
rsc!nCountTitle = 1
rsc.Update
Exit Do
End If
rsj.MoveNext
Loop
Next
rsa.MoveNext
Loop
End If
MsgBox "Done"