locked
Go to new record on opening form RRS feed

  • Question

  • I'm using access 2007 and everytime i open my form it goes to the first record. The problem with this is that other people using this form are typing over the existing record. Even though i put a button on the form labeled "New Record". Is there a way to have the form open to the new record automatically. I have no access experience or coding stuff. Or maybe a way to lock the existing records so they can't be written over. I tried to search for the answer with no luck.

    I'm probably doing this all wrong, but hey its easier than a paper log book. :)

    Thanks in advance.

    Tuesday, April 24, 2012 12:48 PM

Answers

  • If your users are only entering new data and they do not need to look back at older records, you can change the form to Data Entry mode.  In this mode,  when they open the form, it automatically goes to the new record and does not show any others.  Thereafter,users will only see the records they have actually created in the current session. 

    To do this, open the form in Design view and look at the Properties under the Data Tab.  Set Data Entry property to Yes.


    -- Roger Carlson
    MS Access MVP 2006-2012
    www.rogersaccesslibrary.com

    • Marked as answer by Jrmy1 Tuesday, April 24, 2012 1:05 PM
    Tuesday, April 24, 2012 12:57 PM

All replies

  • If your users are only entering new data and they do not need to look back at older records, you can change the form to Data Entry mode.  In this mode,  when they open the form, it automatically goes to the new record and does not show any others.  Thereafter,users will only see the records they have actually created in the current session. 

    To do this, open the form in Design view and look at the Properties under the Data Tab.  Set Data Entry property to Yes.


    -- Roger Carlson
    MS Access MVP 2006-2012
    www.rogersaccesslibrary.com

    • Marked as answer by Jrmy1 Tuesday, April 24, 2012 1:05 PM
    Tuesday, April 24, 2012 12:57 PM
  • Hi,

    if you're sure there is no need in modifying records, you can give a try to changing Allow Edits from Yes to No. Go to the Properties and select Form as an object.

    To go to the new record you can add just one line of code. In the same place (Properties Sheet) go to Event tab, find OnOpen, select [Event Procedure] and hit ... button on the right hand. Here you should have smth like this:

    Private Sub Form_Open(Cancel As Integer)
        DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
    End Sub


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    • Proposed as answer by Kezzla Sunday, April 7, 2013 5:58 AM
    Tuesday, April 24, 2012 1:04 PM
  • You sir are awesome
    Tuesday, April 24, 2012 1:06 PM
  • Rudimentary solution :

    Add a boolean to the form ie. Has_Activated_NewRec

    When opening the form set boolean Has_Activated_NewRec = false

    On Form_current put (at end) some code such as

    If  Has_Activated_NewRec = false then

    ... do a form undo

    ....do a newrec

    Set Has_Activated_NewRec = true

    endif


    Saturday, March 7, 2015 1:10 AM
  • How would I make it go to a specific field? In my case I want it to go to my Date field

    Saturday, December 3, 2016 10:47 PM
  • How would I make it go to a specific field? In my case I want it to go to my Date field

    You can set the focus on the control bound to that field.

    Imb.

    Saturday, December 3, 2016 11:00 PM
  • Brilliant, works perfectly, thank you!
    Wednesday, October 14, 2020 1:17 PM