Results 1 to 6 of 6
  1. #1
    RichardAnderson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    74

    Opening Form To a Record Inside a Target SubForm


    Hello folks,

    Here is the situations....

    frmMainProgram has 2 subforms called SunMain and SubDetails. Inside SubMain is a list of records. When one is selected(clicked), I want another form to open directly to that record inside SubDetails.

    This is the code I have... It open to the right record, but I just cannot figure out how to make it open inside my target subform of SubDetails.
    Code:
    DoCmd.OpenForm "frmProduction_Schedule_Edit", , , "[BuildID]=" & [BuildID]

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would use an invisible TextBox on frmMainProgram as the LinkMasterFields of the SubDetails form and point the ControlSource of the TextBox to the "BuildID" of the current record of the SubMain form. No magical coding required as Access will do all of the work for you.

  3. #3
    RichardAnderson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    74
    Thanks for the reply Rural...

    I am trying your suggestion. I put a hidden txtbox on frmMainProgram and made the control source of it .
    Code:
    =[SubMain].[Form]![BuildID]
    But when I go to set the preference for Link Master Fields on the subform SubDetails, I get a msgbox stating "Can't build a link between unbound forms.
    The Control source of SubDetails in frmProduction_Schedule_Edit so it shouldnt be unbound.

  4. #4
    RichardAnderson is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    74
    I figured it out.... I needed a control source for frmMainProgram.

    Thank you for your help .... youre awesome.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Outstanding! Glad we could help.

  6. #6
    wes9659 is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Location
    Dover, Ohio
    Posts
    88
    So what did the final code look like? I think I have a similar problem with my forms

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

Similar Threads

  1. Opening Query results Inside a Form
    By Nelson12 in forum Forms
    Replies: 6
    Last Post: 12-24-2013, 01:10 PM
  2. Replies: 4
    Last Post: 10-08-2012, 05:33 PM
  3. Replies: 1
    Last Post: 08-11-2011, 06:22 AM
  4. Opening A New Record in a Subform
    By michaelb in forum Forms
    Replies: 4
    Last Post: 05-08-2011, 06:08 PM
  5. Replies: 1
    Last Post: 08-03-2009, 08:24 AM

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