Results 1 to 6 of 6
  1. #1
    newegyptian is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2019
    Posts
    46

    excute goto next on subform2

    Hi
    How i can excute goto next record on subform2



    I tried

    Forms!mainform!subform1!subform2.setfocus
    Docmd.runcommand accmdrecordgotonext


    But failed

    Please help

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Well, to begin with, if you moved off of the line

    Docmd.runcommand accmdrecordgotonext

    you would notice that the accmdrecordgotonext part doesn't become

    acCmdRecordGoToNext

    That's because there's no such command! Try using

    DoCmd.GoToRecord , , acNext

    Where and on what event are you attempting this?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    newegyptian is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Mar 2019
    Posts
    46
    I tried this but failed

    I want to excute on subform2

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    Where and on what event are you attempting this?

    I want to excute on subform2
    I believe Ling means where are you calling this , on which form - Main or Sub form, and what event - Button click or something else.

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    The code for moving to the Next Record is correct...I believe your subform referencing is also off. Here's an excellent reference site for working with Subforms and SubSubForms:

    http://access.mvps.org/access/forms/frm0031.htm

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    Bear in mind that you may also need to trap error (2105?) if there is no next record.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-21-2016, 07:44 PM
  2. Replies: 1
    Last Post: 02-27-2014, 01:57 PM
  3. Replies: 4
    Last Post: 01-26-2012, 01:34 PM
  4. Goto Record
    By jgalloway in forum Forms
    Replies: 8
    Last Post: 09-25-2011, 08:03 AM
  5. On Error GoTo does not resume?
    By easbrandel in forum Programming
    Replies: 5
    Last Post: 04-15-2010, 04:13 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