Click on submenu and active tabs (1 Viewer)

SaranPriya-7954

New member
Local time
Today, 16:10
Joined
Aug 13, 2021
Messages
20
I am trying to activate and hide tabs but my code is not working...can someone assist?

The following is the code written:

Private Sub frmtab_Change()

Select Case Me.frmtab.Value
Case 0
For j = 0 To subTab.Pages.Count - 1
If Left(subTab.Pages(j).Name, 2) = Me("b" & Ax).Name Then
subTab.Pages(j).Visible = True
Me.SubfrmContainer.SourceObject = "subfrmProjects"
Else

'subTab.Pages(j).Visible = False

' End If

' Next j

Case 1
Me.SubfrmContainer.SourceObject = "subfrmAcronyms"

Case 2
Me.SubfrmContainer.SourceObject = "subfrmKeyRequirementsDeliverables"

Case 3
Me.SubfrmContainer.SourceObject = "subfrmObjectives"

Case 4
Me.SubfrmContainer.SourceObject = "subfrmProjectExistingSystem"

Case 5
Me.SubfrmContainer.SourceObject = "subfrmQA"

Case 6
Me.SubfrmContainer.SourceObject = "subfrm3rdPartySupplier"

Case 7
Me.SubfrmContainer.SourceObject = "subfrmStakeholders"

Case 8
Me.SubfrmContainer.SourceObject = "frmDailyItemsAndStatusType"

Case 9
Me.SubfrmContainer.SourceObject = "frmsubAssumptionsConstraints"


Me.Requery


End Select

End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:10
Joined
Oct 29, 2018
Messages
21,467
Hi. Can you explain/describe in plain English what your code is trying to do? We can then try to translate your description into VBA.
 

SaranPriya-7954

New member
Local time
Today, 16:10
Joined
Aug 13, 2021
Messages
20
Once I click on my menu button it brings up a specific form with information. Hence, the case statements. Then I want to proceed in opening and hiding tabs based on that selection.

When I press on a Menu button entitled project it opens a main form with 2 tabs opening at the same time. Once another button is clicked the code looks to see if their is an associated tab(s) and decides whether it should unhide the tab(s) or leave it hidden.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:10
Joined
May 7, 2009
Messages
19,230
is the subform a navigationsubform?
if it is you need to add the command:

DoCmd.BrowseTo
 

SaranPriya-7954

New member
Local time
Today, 16:10
Joined
Aug 13, 2021
Messages
20
is the subform a navigationsubform?
if it is you need to add the command:

DoCmd.BrowseTo
This is not want I want to accomplish. I want to click on the menu button and have the tabs appear. If it is not selected then it is in hide mode. Does someone have the right coding for such a request. I have tried but it is not working.
 

Minty

AWF VIP
Local time
Today, 21:10
Joined
Jul 26, 2013
Messages
10,371
I think your description is clouding our understanding of the issue.
All your code is doing is changing one subform containers sourceobject.

Please post up a picture (mockup if necessary) of what you are trying to achieve?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:10
Joined
Jul 9, 2003
Messages
16,279
I answered a similar question a while back. It was for a password protected Tab.

You can see the code in the video on my website here:-

 

SaranPriya-7954

New member
Local time
Today, 16:10
Joined
Aug 13, 2021
Messages
20
Is there a good book or resource in MS Access VBA which shows you how to properly program? I don't want the usual school book approach. I want to be able to have the correct syntax with examples to access and manipulate form controls for example. I want to programmatically create forms with out binding them and still have them part of a record set for which database relationships still apply. For example 1 project and have many Stakeholders..etc.

Does anyone have this type of resource, which walks you through item meticulously, with real world examples. I just purchased the ms 2016 bible and that book is to much. I would need 6 months just to get through the darn thing.

I welcome all who have an opinion...Based on the feedback I will consider my next Ms access steps. Sorry for the soliloquy but It was important I get this off my chest. lol ...The focus should be on vba manipulating objects.
 
Last edited:

jdraw

Super Moderator
Staff member
Local time
Today, 16:10
Joined
Jan 23, 2006
Messages
15,378
Last edited:

Users who are viewing this thread

Top Bottom