Results 1 to 3 of 3

Thread: Refresh Code

  1. #1
    Join Date
    Nov 2007
    Posts
    7

    Exclamation Unanswered: Refresh Code

    Hi

    I have a form in Access 2007 that has a button to go to the next record. However, when I click on the button I want it to refresh, so it runs the query that needs to be run, as well as going to the next record. The code for going to the next record on click is:



    Private Sub Command21_Click()
    On Error GoTo Err_Command21_Click


    DoCmd.GoToRecord , , acNext

    Exit_Command21_Click:
    Exit Sub

    Err_Command21_Click:
    MsgBox Err.Description
    Resume Exit_Command21_Click

    End Sub



    What code would I add so it would refresh every time it goes to the next record?

    Dave

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Me.Refresh ?
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    A refresh should be done when you record navigate anyway... you shouldn't need to refresh after moving to the next record. I suspect something is wrong tbh.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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