Results 1 to 4 of 4
  1. #1
    Marcia's Avatar
    Marcia is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Aug 2019
    Posts
    37

    Code for clearing a form after refresh

    Hi everyone. I would like the below code to include a command that clears the form ready for a new record after refresh. There is a "AddRecord" button but data entry would be made faster by a code.
    Code:
    Private Sub Remarks_Exit(Cancel As Integer)
      DoCmd.RefreshRecord
      DoCmd.GoToControl "NameOfOwner"
    End Sub
    Private Sub Year1_Exit(Cancel As Integer)
      If [Status] = "CURRENT" Then
      DoCmd.RefreshRecord
      DoCmd.GoToControl "NameOfOwner"
    End If
    End Sub
    Would somebody else please insert the appropriate code. Thank you.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Look at GoToRecord; you'd want to go to a new record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Marcia's Avatar
    Marcia is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Aug 2019
    Posts
    37
    Quote Originally Posted by pbaldy View Post
    Look at GoToRecord; you'd want to go to a new record.
    Thank you Paul.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 03-29-2016, 11:30 AM
  2. Refresh a table using code
    By john134 in forum Programming
    Replies: 2
    Last Post: 01-22-2014, 07:04 PM
  3. Refresh Table Links Code
    By Lowell in forum Programming
    Replies: 5
    Last Post: 03-05-2013, 11:16 PM
  4. Form Code refresh on open
    By mseeker22 in forum Forms
    Replies: 2
    Last Post: 07-08-2011, 12:35 AM
  5. Replies: 3
    Last Post: 10-04-2010, 01:31 PM

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