Results 1 to 4 of 4

Thread: moveNext and MovePrev problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    14

    moveNext and MovePrev problem

    is this the right code for move next?

    Code:
    Dim Ssql As String
    Set rs = New ADODB.Recordset
    Ssql = "select * from StuName order by Fname"
    rs.Open (sql), conn, adOpenStatic, adLockOptimistic
    If Not rs.EOF Then
    rs.MoveNext
    If rs.EOF Then
    rs.MovePrevious
    End If
    End If

  2. #2
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: moveNext and MovePrev problem

    Code:
    Dim Ssql As String
    Set rs = New ADODB.Recordset
    Ssql = "select * from StuName order by Fname"
    rs.Open (Ssql), conn, adOpenStatic, adLockOptimistic
    
    If Not (rs.EOF Or rs.BOF) Then ' ' checking any rowsets available
    rs.movefirst    'moving to topfirst row
    Do While Not rs.EOF ''loop all availbale rows
    msgbox rs!fieldname 'your code
    rs.MoveNext 'moving to next row
    rs.Moveprevious 'moving to next row
    Loop ''end loop
    Endif
    Wait for Senior's post because i am not sure you can catch my description. i am also new to vbsql.
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: moveNext and MovePrev problem

    Why not just take your entire recordset and display it in something like a Listview?

    That way, you don't have to move through it, you can scroll through it.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    14

    Re: moveNext and MovePrev problem

    your code isn't working

    @Hack
    is there no way you can use movenext or previous using textbox?
    Last edited by VBnoobChild; Jan 19th, 2008 at 07:54 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width