Refresh adodc to match record_id in the Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vico20
    New Member
    • Aug 2008
    • 6

    Refresh adodc to match record_id in the Access

    Hi,


    Any suggestion how to refresh adodc to match id (autonumber) in the Access table? When I scroll adodc it does not go from 1 to the last record.

    Thanks

    Milan
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    try to use REQUERY method.

    Comment

    • vico20
      New Member
      • Aug 2008
      • 6

      #3
      Thanks for replay. I add it after AdodcCustomer.R ecordset.Update but it did not make any difference. I must say I do not have much experience in programming This is a part of my code. My form has got a textbox with Request Number that should be populated from Access table and start from 1 when the tools runs or if I scroll adodc scroll bar .

      This a part of my code for Save Button

      Private Sub CmdSave_Click()
      'save records

      If MsgBox("Save changes?", vbQuestion + vbYesNo, "Save") = vbYes Then
      'saves fild to textboxes
      If IsNumeric(TxtSp entHours.Text) = True Then
      AdodcCustomer.R ecordset.Fields ![Spent hours] = TxtSpentHours.T ext
      End If
      AdodcCustomer.R ecordset.Fields ![Contact person] = TxtContact.Text & ""
      AdodcCustomer.R ecordset.Fields ![Started date] = TxtStartedDate. Text
      AdodcCustomer.R ecordset.Fields ![Received] = TxtReceived.Tex t & ""
      AdodcCustomer.R ecordset.Fields ![Job code] = TxtJobcode.Text & ""
      AdodcCustomer.R ecordset.Fields ![Requested_by] = txtRequestedby. Text & “”
      AdodcCustomer.R ecordset.Fields ![Finished by] = TxtFinishedby.T ext
      AdodcCustomer.R ecordset.Fields ![Description] = TxtDescription. Text
      AdodcCustomer.R ecordset.Fields ![Location of data] = TxtLocation.Tex t
      AdodcCustomer.R ecordset.Fields ![Readme file] = TxtReadme.Text
      AdodcCustomer.R ecordset.Fields ![MXD file] = TxtMxd.Text
      AdodcCustomer.R ecordset.Fields ![Comment] = TxtComment.Text

      AdodcCustomer.R ecordset.Update
      AdodcCustomer.R ecordset.Requer y
      Else
      End If

      End Sub

      Comment

      • vico20
        New Member
        • Aug 2008
        • 6

        #4
        Originally posted by debasisdas
        try to use REQUERY method.
        Thanks for replay. I add it after AdodcCustomer.R ecordset.Update but it did not make any difference. I must say I do not have much experience in programming This is a part of my code. My form has got a textbox with Request Number that should be populated from Access table and start from 1 when the tools runs or if I scroll adodc scroll bar .

        This a part of my code for Save Button

        Private Sub CmdSave_Click()
        'save records

        If MsgBox("Save changes?", vbQuestion + vbYesNo, "Save") = vbYes Then
        'saves fild to textboxes
        If IsNumeric(TxtSp entHours.Text) = True Then
        AdodcCustomer.R ecordset.Fields ![Spent hours] = TxtSpentHours.T ext
        End If
        AdodcCustomer.R ecordset.Fields ![Contact person] = TxtContact.Text & ""
        AdodcCustomer.R ecordset.Fields ![Started date] = TxtStartedDate. Text
        AdodcCustomer.R ecordset.Fields ![Received] = TxtReceived.Tex t & ""
        AdodcCustomer.R ecordset.Fields ![Job code] = TxtJobcode.Text & ""
        AdodcCustomer.R ecordset.Fields ![Requested_by] = txtRequestedby. Text & “”
        AdodcCustomer.R ecordset.Fields ![Finished by] = TxtFinishedby.T ext
        AdodcCustomer.R ecordset.Fields ![Description] = TxtDescription. Text
        AdodcCustomer.R ecordset.Fields ![Location of data] = TxtLocation.Tex t
        AdodcCustomer.R ecordset.Fields ![Readme file] = TxtReadme.Text
        AdodcCustomer.R ecordset.Fields ![MXD file] = TxtMxd.Text
        AdodcCustomer.R ecordset.Fields ![Comment] = TxtComment.Text

        AdodcCustomer.R ecordset.Update
        AdodcCustomer.R ecordset.Requer y
        Else
        End If

        End Sub

        Comment

        Working...