Results 1 to 7 of 7
  1. #1
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085

    New Record


    I have an Access 2010 Database. The primary form is going to be used for data entry. 90% of the time it will be to input a new record. What I'd like is when the form opens it opens to a New Record but the form needs to be Allow Edit. I haven't been able to make this work as yet any thoughts? Also the Form is based on a table not a query.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What have you tried?

    Could have code in the form Open event to move to new record row.

    Or open it with code behind a button on another form:

    DoCmd.OpenForm "formname", , , , acFormAdd
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    The form is the startup form. I tried using a macro that fired when the form was opened to move to a new record row but that just generated errors. Your first option is what I had in mind but I cant find the method to move the form's recordset to a new record. I know I did this before but that was Access 2003 and a number of years ago. Don't remember how I did it and nothing I've tried works. Thanks for your help.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Have you tried:

    DoCmd.GoToRecord acDataForm, "formname", acNewRec

    What have you tried?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I just added the following line of code to the Form_Load event, and it seems to work well. It opens to a new record, but if I press the "back" record selector button to View/Edit existing records, I do not get any errors.
    Code:
    Private Sub Form_Load()
        DoCmd.GoToRecord , , acNewRec
    End Sub

  6. #6
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Thanks I'll try that.

  7. #7
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    worked like a charm

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

Similar Threads

  1. Replies: 4
    Last Post: 07-03-2013, 10:02 AM
  2. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  3. Replies: 2
    Last Post: 12-21-2012, 01:57 PM
  4. Replies: 4
    Last Post: 12-14-2012, 06:33 PM
  5. Replies: 3
    Last Post: 08-26-2012, 10:04 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