Home All Groups Group Topic Archive Search About
Author
13 May 2005 5:38 AM
Amarios
"the following message has been send to another ng lately, but with no
reply.
Sorry for double-posting, but it drives me crazy."

Hello all,

my project consists of an Access 2000 mdb file conatining and Index column
and 20 Song columns, a DataEnvironment and a form showing the Find records
On Command1.Click to search the records the following occur:

Private Sub Command1_Click()

'DEFINITION OF THE PROBLEM...
'On searching of the 6th out of 20 columns (j=6) in the first record
'       it changes the Bookmark/Recordset line position unexpectetly
'Columns 1,2,4,7,9,10,14,15,16,17 in the first row contain matching data


With de '(Data Environment)

..rsCommand1.MoveFirst
iRecCount = .rsCommand1.RecordCount
j = 1

For i = 1 To iRecCount

varBookmark = .rsCommand1.Bookmark

    Do

    If j = 21 Then Exit Do

        strFind = "Song" & j & " Like '*" & Text1.Text & "*'"

            .rsCommand1.Find strFind

'If no match is found, EOF = True. Must return to previous state +1
                If .rsCommand1.EOF = True Then
                    .rsCommand1.Bookmark = varBookmark
                Else
                    MsgBox "Index Nr. is " & .rsCommand1(0).Value _
                            & " Column Nr. is " & j
                End If
                j = j + 1

    Loop

..rsCommand1.MoveNext
j = 1

Next i

End With

End Sub

AddThis Social Bookmark Button