Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56

    Conditional Visibility - based on sub-forms


    I have a main form with several subforms within it. These subforms are navigation tabs. In the footer of the main form I have a textbox that I want to hide unless the 2nd tab is selected.

    Details:
    3 Tabs, 1 subnavigation subform, 3 tab indexes(0,1,2)
    tab index 1 the textbox on the main form(parent) should be visible. tab index 0 and 2 the textbox should be hidden.

    Any idea how I can do this?

    I was thinking I could do something like when tab index 1 is onFocus then textbox = visible and vice versa on the other tab indexes?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Is this a tab control, not a navigation form?

    Determine which page of tab control has focus by testing the Value property of the tab control. Value of tab control is the index of the tab page.

    Me.textboxname.Visible = Me.tabcontrolname.Value = 1

    That code would probably have to be in the form Current event and the tab control Change event.
    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
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    Where is the name of the "tabcontrolname"? Is that the name of the tab itself or somewhere else? Right now the tab names are still default chosen names such as 'NavigationButton9'.

  4. #4
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    Here is what I tried and it didn't work, compile error:

    Private Sub Form_Current()
    Me.tbox_total.Visible = Me.NavigationButton9.Value = 1
    End Sub

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    If this is a navigation form (see question in post 2), I can't help.
    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.

  6. #6
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    its a tab control. Index is 1. I'm not sure where to put that code yet.

    Private Sub Form_Current()
    Me.tbox_total.Visible = Me.NavigationButton9.Value = 1
    End Sub

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    NavigationButton9 is the default name of tab control?

    My default name is like TabCtl89.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  8. #8
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    Yes, my tab control that I inserted to my main form the tab's at the top are all named "NavigationButton". I have 3 tabs in that navigation frame. The tab I want the textbox(tbox_control) to be visible on is "Tab Index 1".

    I may have renamed the default Tab Control names earlier and forgot sorry.

    Office 2010

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Navigation frame?

    Guess I need pictures.

    All I can say is the code I suggested works for me.
    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.

  10. #10
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    Here is pic of main form in design view..
    Attached Files Attached Files

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    That looks like a navigation form.

    How did you create this form/subform arrangement.
    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.

  12. #12
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    I started with a blank form. In the Form Design ribbon I used the control "Tab Control" and dragged the control into the form to create my tabs. Then in each tab I linked their "Navigation Target Name" to pre-built forms. So each tab is opening a form but they are in tab form.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    When I drag a tab control to form I don't have 'Navigation Target Name' property. I do see that property when I create a navigation form. Therefore you have a navigation form. I can't help you. I don't like nor use navigation form.

    Referencing controls on navigation form is too frustrating for me.

    Best I can offer is suggest you search the forum on topic navigation form, restrict to my user name if you want. I have responded to several in attempts to help with navigation form. Here is one
    https://www.accessforums.net/forms/t...orm-32053.html
    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.

  14. #14
    twildt is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    56
    Your right, I somehow have navigation control with tabs. Anyone else got any advice for me?

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Don't use navigation form. Don't use wizards (I never do).

    Create a normal form. Click Form Design from the Create ribbon. In design view add tab control.
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 07-11-2013, 02:19 PM
  2. Field visibility based on ComboBox selection
    By cactuspete13 in forum Forms
    Replies: 3
    Last Post: 01-30-2013, 03:37 PM
  3. Replies: 8
    Last Post: 01-25-2012, 02:07 PM
  4. Replies: 3
    Last Post: 09-08-2011, 10:53 AM
  5. Visibility based on Combo selection
    By jlclark4 in forum Forms
    Replies: 1
    Last Post: 12-22-2010, 11:42 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