Results 1 to 3 of 3
  1. #1
    oohzzur is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    4

    How to goto a specific record in a recordset displayed on a subform in another subfrom on a mainform

    Good day All,

    Can anyone help in resolving this challenge.



    I am working with MS Access to write a program to assist students prepare for an exam. I want students to be able to go back and review questions that have not been answered which are displaced on a pop form at the students request. I want the student to be able to select a specific question on the pop up form and that question should be made the current record that is displayed in the subform inside another subform on the mainform. The challenge is that when I click on the question number on the pop form, I dont get any response. I tried to set focus to the sub sub form and then call the subform using docmd.gotorecord but I keep getting various errors.

    Below is sample code block in a command button click event that when clicked should automatically displayed question 3 in the recordset.

    Code:
    sub command3_click()
    forms!formmain!child52!child65.setfocus
    docmd.gotorecord acdataform, "formmain!child52!child65", acgoto, 3
    
    end sub.
    my main form is formmain
    the first subform is child52
    the second subform is child65.

    ALthough not indicated in the code, the records are displayed on a form named form4 in the child65 subform container.

    Any assistance will be greatly appreciated.

    oohzzur

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Link the subforms to the main form using master and child link properties. Then set the link field on the main form when they select the question and requery.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Could definitely use more meaningful names.
    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.

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

Similar Threads

  1. Replies: 0
    Last Post: 12-29-2016, 11:19 PM
  2. Replies: 2
    Last Post: 07-02-2015, 09:38 AM
  3. Goto specific Record in DAO RecordSet
    By Phil1 in forum Programming
    Replies: 8
    Last Post: 04-09-2012, 05:23 PM
  4. Goto record in subform - sometimes
    By RasterImage in forum Forms
    Replies: 6
    Last Post: 09-13-2011, 04:36 PM
  5. Goto a new record in tabbed subform
    By snoopy2003 in forum Programming
    Replies: 3
    Last Post: 03-05-2011, 04:24 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