Results 1 to 2 of 2
  1. #1
    Tomfernandez1 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    74

    2010 MS Access 'RefreshAll' Automation


    Hello All!

    I have created a Form with a command button that moves the current record from one Table to another. The code behind the command button is provided below.
    The problem is, after the code is executed, all that remains on the Form fields is "deleted". Is there something I can add to the end of the code that would RefreshAll?
    I hit the RefreshAll button and it worked, but I am hoping to automate this step through VBA code.

    Thanks, in advance, for your attention to my post!

    Tommy



    Private Sub Command640_Click()

    DoCmd.SetWarnings False
    DoCmd.OpenQuery "TEST_QUERY_APPEND", acViewNormal, acEdit
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "TEST_QUERY_DELETE", acViewNormal, acEdit
    DoCmd.RefreshRecord

    End Sub

  2. #2
    Tomfernandez1 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    74
    I found the answer to my question after doing some online research. The answer is in an article through this link: http://office.microsoft.com/en-us/ac...41940.aspx#BM4

    As a result, here is the code revised:

    Private Sub Command640_Click()

    DoCmd.SetWarnings False
    DoCmd.OpenQuery "TEST_QUERY_APPEND", acViewNormal, acEdit
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "TEST_QUERY_DELETE", acViewNormal, acEdit
    Me.requery
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 17
    Last Post: 08-03-2011, 05:19 PM
  2. MS Access 2003 Automation
    By shirurkarsunil in forum Access
    Replies: 2
    Last Post: 01-15-2011, 12:57 AM
  3. Replies: 0
    Last Post: 03-04-2010, 06:32 PM
  4. Access and Word Automation
    By djreyrey in forum Forms
    Replies: 1
    Last Post: 01-08-2010, 02:33 PM
  5. access 2003 automation issue
    By BevA in forum Programming
    Replies: 2
    Last Post: 05-01-2006, 08:37 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
  •  
Other Forums: Microsoft Office Forums