Add a button to a form to add new (blank) record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hannoudw
    New Member
    • Aug 2010
    • 115

    Add a button to a form to add new (blank) record

    Hi i searched here but i didn't find out how to add a button and when i click on this button to open a new blank record?
    I could really need some help. many thanks :)
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Are you ready to quote Homer Simpson and say "Doh?"

    In Form Design View, add a Command Button to you form, and when the Command Button Wizard comes up, under "Categories" click Record Operations, then under "Actions" click on Add New Record. Follow the prompts and you're done.

    The pertinent VBA code generated will be

    DoCmd.GoToRecor d , , acNewRec

    Linq ;0)>

    Comment

    • Jerry Maiapu
      Contributor
      • Feb 2010
      • 259

      #3
      Just for your infor: If the wizard does not start/pop-up, simply
      copy and paste this code missinglinq gave on the On_Click event of the New Record button:
      Code:
      DoCmd.GoToRecord , , acNewRec
      Passing by:

      JM

      Comment

      • Nkosi
        New Member
        • Jul 2016
        • 3

        #4
        In 2013 in generates a macro automatically and does not set focus on the first field in the Tab Index (0)

        Comment

        Working...