Results 1 to 9 of 9
  1. #1
    AccessHelp! is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    5

    Access 2016 Main form linking to Navigation form

    Hello,

    I know this question is probably easy but I can't seem to figure it out. I have a form with a navigation subform in it and I want the navigation subform to load the same ID as the main form. How would I do this?

    Form has ID # 1279

    navigation subform ID # 1 currently
    when I click on tabs how can I have them match



    Navigation subform tabs open up another 2 forms
    Tab 1 Navigation Target name frmBuildingDetails
    Tab 2 Navigation Target name frmBuidlingWeb

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    What do you mean the main is blank? If you 'load' this form, how is it blank?

    Simplest approach is to use subform container control on a Tab control instead of Navigation form.
    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.

  3. #3
    AccessHelp! is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    5
    The form has a navigation subform in it. I tried the Tab Control it worked great but other issues came up so need to use navigation form if possible. I edited my post to try to make it more clear.
    Thanks

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Not sure what you are asking because of the terminology you use (I think). F'rinstance, what is a "form ID"?
    Your issue might be able to be explained by pointing out the behaviour of navigation forms. Only ONE form is ever loaded. Choose a different tab, form closes, chosen one opens. Thus it is difficult to pass values from one to another if that's what you're asking for. Simplest way is probably to have a public module level variable that gets set when a form opens and then retrieve the value from the second form. Sorry if I've misunderstood your issue.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    AccessHelp! is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    5
    Field Name ID number for the record that I want. Can I use Navigation where clause?

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Can I use Navigation where clause?
    I had to look that up, not being a big fan/user of nav forms beyond helping others in forums with their issues. Seems to me that is a means of applying a filter to the same form, which would affect the records it shows.
    Field Name ID number for the record that I want.
    If that is your answer to my question "what is a form ID" then I'm none the wiser as to what it is, where it comes from, or what you want to do with it.

  7. #7
    AccessHelp! is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    5
    I have a table called tblBuilding with field names ID_BuidlingName_Address_etc
    Then I have a form with a navigation subform insert into it
    This form name is called frmBuildingA
    When I load frmBuildingA I use this to open it docmd.openform "frmBuildingA", , , "ID = " & 1279, , acWindowNormal
    frmBuildingA loads the record for ID# 1279
    I want the navigation subform that has frmBuildingWeb (Navigation Subform Target)
    to load with this same record.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Do you want the same record on Navigation Subform or do you mean related records of dependent table?

    Navigation Subform does not have Master/Child links properties as found with subform container control. You would have to apply filter criteria to the target form. I did a simple test and this worked.

    Private Sub Form_Current()
    Me.NavigationSubform.Form.Filter = "ID_FK=1"
    Me.NavigationSubform.Form.FilterOn = True
    End Sub

    Private Sub NavigationButton7_Click()
    Me.NavigationSubform.Form.Filter = "ID_FK=1"
    Me.NavigationSubform.Form.FilterOn = True
    End Sub


    What issue did you encounter with Tab control?
    Last edited by June7; 12-13-2019 at 05:08 AM.
    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.

  9. #9
    AccessHelp! is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    5
    Thanks for everyone's help!
    June7 I looked further into the tab control you suggested and it works perfectly! Missed a simple thing had Master and Child linked incorrectly. Thanks

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

Similar Threads

  1. Replies: 3
    Last Post: 06-17-2018, 01:46 PM
  2. Replies: 7
    Last Post: 05-12-2018, 06:44 AM
  3. Replies: 10
    Last Post: 07-05-2017, 11:31 AM
  4. Replies: 0
    Last Post: 12-29-2016, 11:19 PM
  5. Replies: 8
    Last Post: 09-14-2015, 09:38 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