none
Access VBA go to new row RRS feed

  • Question

  • Hello!

    Might be the wrong forum but i didn't find Access category.

    I have a form in access. After the form is filled and data is saved i face a problem. The form delete the entered data to jump to a new row.

    If i dont jump to a new row then it will edit the already existing row, which is not good either.

    How can i go to next row without clear the data?

    I use these 2 command to save and jumpt to new record:

    DoCmd.RunCommand acCmdSaveRecord
            DoCmd.GoToRecord , "", acNewRec


    I Hate Mondays

    • Moved by Bill_Stewart Thursday, January 19, 2017 6:19 PM Move to more appropriate forum
    Thursday, January 19, 2017 3:44 PM

Answers

  • You guessed it.  Wrong forum.  Use Access VBA forum

    Note that moving to next row "" will insert a blank record.  It does not clear the data.  If you want to copy the row then copy and insert it then go to the copied record.

    https://bytes.com/topic/access/answers/844631-copy-record-new-record


    \_(ツ)_/


    • Edited by jrv Thursday, January 19, 2017 4:49 PM
    • Marked as answer by Lokids Friday, January 20, 2017 10:28 AM
    Thursday, January 19, 2017 4:48 PM
  • Hi Lokids,

    DoCmd.RunCommand acCmdSaveRecord

    it will save the record.

    so I think that problem is related with the line below.

       DoCmd.GoToRecord , "", acNewRec

    I suggest you to pass Object type and Object name in the parameter.

    Example:

    DoCmd.GoToRecord acDataForm, "Employees", acGoTo, 7
    

    Reference:

    DoCmd.GoToRecord Method (Access)

    let me know if problem is exist after passing parameters. I will try to suggest you further to solve the issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Lokids Friday, January 20, 2017 10:28 AM
    Friday, January 20, 2017 3:05 AM
    Moderator

All replies

  • You guessed it.  Wrong forum.  Use Access VBA forum

    Note that moving to next row "" will insert a blank record.  It does not clear the data.  If you want to copy the row then copy and insert it then go to the copied record.

    https://bytes.com/topic/access/answers/844631-copy-record-new-record


    \_(ツ)_/


    • Edited by jrv Thursday, January 19, 2017 4:49 PM
    • Marked as answer by Lokids Friday, January 20, 2017 10:28 AM
    Thursday, January 19, 2017 4:48 PM
  • Here is the Access forum. https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=accessdev

    We do not support Office products in this forum.


    \_(ツ)_/

    Thursday, January 19, 2017 5:05 PM
  • Hi Lokids,

    DoCmd.RunCommand acCmdSaveRecord

    it will save the record.

    so I think that problem is related with the line below.

       DoCmd.GoToRecord , "", acNewRec

    I suggest you to pass Object type and Object name in the parameter.

    Example:

    DoCmd.GoToRecord acDataForm, "Employees", acGoTo, 7
    

    Reference:

    DoCmd.GoToRecord Method (Access)

    let me know if problem is exist after passing parameters. I will try to suggest you further to solve the issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Lokids Friday, January 20, 2017 10:28 AM
    Friday, January 20, 2017 3:05 AM
    Moderator