Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Posts
    69

    Unanswered: Go to last record in form

    Does anybody know a code to use that when you start a form he goes directly to the last record (>* new record) so avoid the users will change data in an existing record.

  2. #2
    Join Date
    Nov 2003
    Posts
    267
    If you don't want the users to edit existing data. change the allow edits property to no, or open form in add mode from switchboard

    S-

  3. #3
    Join Date
    Nov 2003
    Location
    San Francisco, CA USA
    Posts
    59

    Re: Go to last record in form

    Add an onLoad event property to the form and put this in it.

    Me.DataEntry = True

    That'll do it. But it means that form always opens in data entry mode.

    Originally posted by west
    Does anybody know a code to use that when you start a form he goes directly to the last record (>* new record) so avoid the users will change data in an existing record.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    If you need the users to have the ability to scroll back and edit old data, but just don't want them accidentally changing existing data, put this code in your form's OnOpen event:

    On Error Resume Next
    DoCmd. GoToRecord , , acNewRec
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Nov 2003
    Posts
    1,487
    If the said Form will be opened from a Command Button then place the sample code into the On Click event for the Command button:

    DoCmd.OpenForm "yourFormName", , , , acFormAdd

  6. #6
    Join Date
    Sep 2003
    Posts
    69
    Yest thank you very much,

    On Error Resume Next
    DoCmd. GoToRecord , , acNewRec

    works very well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •