By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,652 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,652 IT Pros & Developers. It's quick & easy.

Horizontal Navigation Access2013, Link main form to subform text

P: 2
As simple as that, appreciate, really if anyone can write the VBA code please, I have the home page, horizontal navigation from which includes many navigation buttons, under NavigationButton7 I have employeesfrm, and I need to navigate Next or previous while I am in the home form , the ID embedded within the employeesFrm, so the VBA code when on unload of the employeesfrm , (not on the home form), is not giving the right ID while I am on the home form. please support..
I have tried Froms!home!navigationSubform!ID , but this will give error cause any ID within any other NavigationButton8 or 9 will give another result, and I am not interested to know the ID of the other forms in other buttons. my concern is just to have a link between the ID within the employeesfrm and the Home form text.

noting is working from the below
Expand|Select|Wrap|Line Numbers
  1. Dim MyIDS As Integer
  2.  
  3. MyIDS = Me.ID ' this is giving only the first ID number all the time.
  4.  
  5. MyIDS = Forms![Home]![NavigationSubform].[Form]![employeesfrm]![ID] ' this is giving error.
  6. MyIDS = Forms![Home]![NavigationSubform]![Navigationform]![studentsfrm]![ID] ' this is giving error.
  7.  

MyIDS = Forms![Home]![NavigationSubform].Form![ID] ' this one works but if I am on another Navigation button, lets say 8 not 7, I am not interested in the number...

if anyone wonders why I want this number, I need it for my bookmark, it works fine if I am directly on the employeesfrm, but not on the home form,
thx a lot

Attached Images
File Type: jpg Capture.jpg (43.3 KB, 226 views)
Dec 30 '16 #1

✓ answered by zmbd

Hello Zeee :)
I have a serious love-hate relationship with the Access2013 and newer Navigation-Control - LOVE the layout design concept and hate some of the quirks

First, please read thru my post here:
https://bytes.com/topic/access/answe...ms#post3760995
I go into a great deal of detail here about this type of control and once you read it you will understand why what you are doing is not working as anticipated.

IN BRIEF
Each time you click on the NavigationControlCommandButton (NCCB),
these are not tabs, the subform linked to that button is newly reloaded.

What you have is:
+ One Parent Form
+ One Subform control which all subforms are loaded into when a NCCB is triggered.
+ A whole lot of NCCB, potentially grouped in two or more layers (tiers) and not only can a First-Tier Button (FTB) have several second-tier buttons grouped to it, the FTB can have its own subform assigned to it as can each of the sub-tier NCCB! Each time you click on one of the NCCB any associated group of sub-tier buttons is shown and the associated subform is reloaded from scratch!.

To pass information between the forms when triggering a NCCB to navigate thru your database; you need to store the desired value using one of the following options, the best option depends on your intent:
Control on the main form
Use the browse to method
TempVars collection

- I don't usually use the control on the Main form for this.
- I do use the Browse To method quite often
- I have used the TempVars collection for things I need to keep for the duration of the active session or a multistep user interaction

Share this Question
Share on Google+
1 Reply


zmbd
Expert Mod 5K+
P: 5,397
Hello Zeee :)
I have a serious love-hate relationship with the Access2013 and newer Navigation-Control - LOVE the layout design concept and hate some of the quirks

First, please read thru my post here:
https://bytes.com/topic/access/answe...ms#post3760995
I go into a great deal of detail here about this type of control and once you read it you will understand why what you are doing is not working as anticipated.

IN BRIEF
Each time you click on the NavigationControlCommandButton (NCCB),
these are not tabs, the subform linked to that button is newly reloaded.

What you have is:
+ One Parent Form
+ One Subform control which all subforms are loaded into when a NCCB is triggered.
+ A whole lot of NCCB, potentially grouped in two or more layers (tiers) and not only can a First-Tier Button (FTB) have several second-tier buttons grouped to it, the FTB can have its own subform assigned to it as can each of the sub-tier NCCB! Each time you click on one of the NCCB any associated group of sub-tier buttons is shown and the associated subform is reloaded from scratch!.

To pass information between the forms when triggering a NCCB to navigate thru your database; you need to store the desired value using one of the following options, the best option depends on your intent:
Control on the main form
Use the browse to method
TempVars collection

- I don't usually use the control on the Main form for this.
- I do use the Browse To method quite often
- I have used the TempVars collection for things I need to keep for the duration of the active session or a multistep user interaction
Jan 22 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.