is there any possibilities that you can make a vb6 code, that can search backwards from last to first?


first, i just want to apologize for disturbing you..x)

i mean, from an access 03 database

i inputed in the fieldname: studentnumber

then, i entered below, five(5) records of studentnumber(fieldname) with same value 00001..( this was inputed in access 03 database, not in a vb6 project to lessen the time)

so there are five(5) of same studentnumber, w/c is 00001?

so, here is the thing, a vb6 code using (textbox1_change) must search backwards start from the fifth(5th) record 00001 to the first record...
(the searched studentnumber must shown also in a textbox2)

with a moveprevious and movenext commandbuttons...(to determine if it starts from last to first string)

if you know this one, can i do a favor? to make an example and post it here.

cause i just also want to know it...

remember: sharing is good... for like me who wants to know the possibilities.

hope you help me, that's if your not busy...

thanks in advance...GOD bless...

all answers is much more appreciated... again thanks for sharing..

And my especial thanks to vb5prgrmr... (for sharing this site)

i think i need to put my working code...

cause i just recently received a warning? dont post a word "help" or "problem" without your own code problems... and don't make them force to make a code for you...

i realy really sorry for that... i just dont do it again..

thanks for the warning...(walp)

im sorry, for forcing you or for doing a favor?

here: help me fixed it

this code is can search only the first record not the last record?

Private Sub old_Change()' this is a text boxt

On Error Resume Next

"Designer"     ."Tablename". "Command"
    |	             |          |
DataEnvironment1.rsTranSub.MovePrevious
''''''''''''''''''''''''''''''''''''
DataEnvironment1.rsTranSub.MoveLast
DataEnvironment1.rsTranSub.MoveNext
DataEnvironment1.rsTranSub.MoveFirst

On Error Resume Next

Dim findstr As String

    If Not DataEnvironment1.rsTranSub.Supports(adFind) Then
        MsgBox " Doesn't support Recordset "
        
    Else
        If DataEnvironment1.rsTranSub.Supports(adBookmark) Then
           lastrow = DataEnvironment1.rsTranSub.Bookmark
        
        End If
        
        findstr = old.Text
        If findstr = "" Then Exit Sub



        'DataEnvironment1.rsTranSub.Movelast
 
' I think here is the code i can't fixed below:
      
        	DataEnvironment1.rsTranSub.find "studentnumber LIKE '*" & findstr & "*'"
                
         '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     If DataEnvironment1.rsTranSub.EOF Then
               MsgBox "No records found!" & findstr
          
            If DataEnvironment1.rsTranSub.Supports(adBookmark) Then
                DataEnvironment1.rsTranSub.Bookmark = lastrow
         
            End If
      End If
        End If
    
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.