Jump to content

MS Access

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
moonrise

moonrise

    Learning Programmer

  • Members
  • PipPipPip
  • 40 posts
I have a VB6 application which uses MS Access as its backend.

Im familiar with Access and therefore how to place the record
navigation buttons for:

First Record
Next Record
Previous Record
Last Record

How would i code this in VB 6?

I tried the following code on the first button but it doesnt go to the
first record

rsExecDet.MoveFirst

Me.txtRecordCaption = "Record " & rsExecDet.AbsolutePosition & " of " &
intRecordCount


#2
mrbar

mrbar

    Newbie

  • Members
  • PipPip
  • 10 posts
These are the codes i've done and so far it works well

Private Sub cmdFirst_Click()
    Adodc1.Refresh
    
    If txtName.Text = "" Then
        'Do nothing
    ElseIf Adodc1.Recordset.BOF = True Then
        'Do nothing
    Else
        Adodc1.Recordset.MoveFirst
    End If
End Sub

Private Sub cmdLast_Click()
    Adodc1.Refresh
    
    If txtName.Text = "" Then
        'Do nothing
    ElseIf Adodc1.Recordset.EOF = True Then
        'Do nothing
    Else
        Adodc1.Recordset.MoveLast
    End If
End Sub

Private Sub cmdPrev_Click()
    If txtName.Text = "" Then
        'Do nothing
    ElseIf Adodc1.Recordset.BOF = True Then
        'Do nothing
    Else
        Adodc1.Recordset.MovePrevious
    End If
End Sub

Private Sub cmdNext_Click()
    If txtName.Text = "" Then
        'Do nothing
    ElseIf Adodc1.Recordset.EOF = True Then
        'Do nothing
    Else
        Adodc1.Recordset.MoveNext
    End If
End Sub


#3
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
Please remember to use the code-tags, both of you. It makes the text more readable.

#4
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
I added the Code Tags.

Anyways moonrise did you try mrbar code? did it work?

I +rep mrbar for his effort.