473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Navigation Control - Subforms

Hi guys,

I have in the past referred to controls on subforms without any issue, however with the new navigation control there does not seem to e a subform to refer to other than NavigationSubForm.

I have tried the following:

Me![NavigationSubform]![prjCustomer] = Forms![menu]!cmbCustomer
Me![NavigationSubform]![cCustomer] = Forms![menu]!cmbCustomer

I have also tried:

Forms![Menu]![NavigationSubform]![prjCustomer] = Forms![menu]!cmbCustomer
Forms![Menu]![NavigationSubform]![cCustomer] = Forms![menu]!cmbCustomer


This only works when the subform has the focus i.e. if I am on the Project Overview Subform then the prjCustomer field is updated with the value in cmbCustomer, but the cCustomer field comes up with an error saying it cannot find the field.

If I move onto the Contacts form then the cCustomer field updates with the value in cmbCustomer, but the prjCustomer field comes up with an error saying it cannot find the field.

Essentially I want to have a field on my Navigation Control called cmbCustomer and when I update this I want the value to be written into every Customer field on each of the subforms on the Navigation Control. This is so the user only has to select customer once and all the data entry on the other forms will automatically be updated with the customer name.

Hope that makes sense - any light someone can shed on this would be appreciated.
Nov 17 '13 #1

✓ answered by zmbd

ccocker:

Hang tight!
I had one (many explictives) learning to use this control.

Things to keep in mind:
- The new navigation pane works much like a late bound tab control. It is NOT however at all like a tab control
- Each time you click on a new navigationcontrol button/tab, the associated subform is RELOADED from SCRATCH. The subform on the control that you were on is UNLOADED; thus, anything that you had set on that form is NO LONGER available! You have to use the onclose events, temp and module level variables, and other tricks to preserve and transfer the infromation.
- There is ONE navigation control container on the parent form. This is where all of the subforms refered to by the navigation button/tabs will load. Therefor, ignore the button name and go from the parent to the navigation control then the subform therein.
This will sometimes get you the correct reference and helpeed me a few times: How to refer to subforms in control sources There's a trick to this with the navigaton control - while in design view make sure that the correct subform is showing... and this doesn't always work.
Your basic reference is something like this and assumes that you haven't changed the default navigation container name:
[Forms]![frmParentform]![frmNavigationsubform].[form].(somecontrolhere)

I'll update here with a better example in a few hours after I get a nap and goto work :)

()Also, almost as an aside this is a very handy link to have when working with subforms and was actually of some use while trying to learn the new nav control:
Refer to Form and Subform properties and controls

I'm glad this worked out.
By way of finishing the reference as promised in my first post :)

So I have a calculated control that requires the value from the subform of the parent form within the navigation control.
Unless you have subforms within subforms this is more than likely as bad as it gets.

So We have three forms involved here:
frm_navigation: This is the switchboard. It has all the pretty buttons along the top and side for user navigation.
frm_qry_asset_inventory_logbook: This is the parent form that is bound to the navigation control button. It's a fairly complex query driving this form; however, as one scrolls or searches within this form for an asset, the subform pulls the historical information.
sfm_qry_asset_inventory_logbook this is the subform frm_qry_asset_inventory_logbook that pulls the related records from the history/logbook table for the selected asset in the parent.

We then have the bound control on the subform that I'm after:
[history_fk_inventory] which is bound to that recordsource field in the sfm_qry_asset_inventory_logbook form. I need to pull this value into a control on the parent for a calculation.

So this is what it looks like in the calculated control (ok only partially this has a very long set of calcs)
Expand|Select|Wrap|Line Numbers
  1. =[Forms]![frm_navigation]![NavigationSubform].[Form]![sfm_qry_asset_inventory_logbook]![history_fk_inventory]
so to break this down by step:

Expand|Select|Wrap|Line Numbers
  1. [Forms]!                '<Forms Collection 
  2.                            of the database
  3.  
  4. [frm_navigation]!       '<The Switchboard form
  5.  
  6. [NavigationSubform].    '<The default name of the
  7.                            new Acc2010 navigation control
  8.  
  9. [Form]!                 '<Tells us to look at 
  10.                              the form property of the
  11.                              navigation control, 
  12.                              in this case it 
  13.                              is the parent form: 
  14.                              frm_qry_asset_inventory_logbook
  15.  
  16. [sfm_qry_asset_inventory_logbook]! '< This is the subform of the 
  17.                              Currently loaded parent form
  18.  
  19. [history_fk_inventory]  '< and finally the 
  20.                              control of interest. <
So that got me to the control on the subform of the parentform loaded into the navigationcontrol.

What if we needed to get a control on the currently loaded form in the navigation control (we're still using the three afor mentioned forms here):
Expand|Select|Wrap|Line Numbers
  1. [Forms]![frm_navigation]![NavigationSubform].[Form]![Inventory_pk]
Note I did not use "frm_qry_asset_inventory_logbook"

In fact, if you clicked on a second button, and it loaded a new form (say frm_example2) with the bound control named "[example_pk]" then the reference to that control would be
Expand|Select|Wrap|Line Numbers
  1. [Forms]![frm_navigation]![NavigationSubform].[Form]![example_pk]
Clear as mud... was for me too.

Fourtunately however, when working within the loaded form; the "ME." construct holds true as does any of the references internally to the form using "Me." and the normal subform references (for example say:
in vba:
sfm_qry_asset_inventory_logbook
wanted to address the recordset for:
frm_qry_asset_inventory_logbook
(both of which are currently loaded into "NavigationSubform"

then the in vba code within "sfm_qry_asset_inventory_logbook" need only use the construct: Me.Parent.RecordSource and other constructs as shown in the link provided earlier.

-
Moveing data: there is, in the navigation control, the tab (button) that is associated with the form, a property, "Navigation Where Clause"
I've just started playing with this... taking the inventory forms... I have a tab that loads the inventory form... I already have a tab that has the history details... so I've been working with this property so one could select the item in the inventory pane and go directly to that item in the history side.

6 37286
zmbd
5,501 Expert Mod 4TB
ccocker:

Hang tight!
I had one (many explictives) learning to use this control.

Things to keep in mind:
- The new navigation pane works much like a late bound tab control. It is NOT however at all like a tab control
- Each time you click on a new navigationcontrol button/tab, the associated subform is RELOADED from SCRATCH. The subform on the control that you were on is UNLOADED; thus, anything that you had set on that form is NO LONGER available! You have to use the onclose events, temp and module level variables, and other tricks to preserve and transfer the infromation.
- There is ONE navigation control container on the parent form. This is where all of the subforms refered to by the navigation button/tabs will load. Therefor, ignore the button name and go from the parent to the navigation control then the subform therein.
This will sometimes get you the correct reference and helpeed me a few times: How to refer to subforms in control sources There's a trick to this with the navigaton control - while in design view make sure that the correct subform is showing... and this doesn't always work.
Your basic reference is something like this and assumes that you haven't changed the default navigation container name:
[Forms]![frmParentform]![frmNavigationsubform].[form].(somecontrolhere)

I'll update here with a better example in a few hours after I get a nap and goto work :)

()Also, almost as an aside this is a very handy link to have when working with subforms and was actually of some use while trying to learn the new nav control:
Refer to Form and Subform properties and controls

I'm glad this worked out.
By way of finishing the reference as promised in my first post :)

So I have a calculated control that requires the value from the subform of the parent form within the navigation control.
Unless you have subforms within subforms this is more than likely as bad as it gets.

So We have three forms involved here:
frm_navigation: This is the switchboard. It has all the pretty buttons along the top and side for user navigation.
frm_qry_asset_inventory_logbook: This is the parent form that is bound to the navigation control button. It's a fairly complex query driving this form; however, as one scrolls or searches within this form for an asset, the subform pulls the historical information.
sfm_qry_asset_inventory_logbook this is the subform frm_qry_asset_inventory_logbook that pulls the related records from the history/logbook table for the selected asset in the parent.

We then have the bound control on the subform that I'm after:
[history_fk_inventory] which is bound to that recordsource field in the sfm_qry_asset_inventory_logbook form. I need to pull this value into a control on the parent for a calculation.

So this is what it looks like in the calculated control (ok only partially this has a very long set of calcs)
Expand|Select|Wrap|Line Numbers
  1. =[Forms]![frm_navigation]![NavigationSubform].[Form]![sfm_qry_asset_inventory_logbook]![history_fk_inventory]
so to break this down by step:

Expand|Select|Wrap|Line Numbers
  1. [Forms]!                '<Forms Collection 
  2.                            of the database
  3.  
  4. [frm_navigation]!       '<The Switchboard form
  5.  
  6. [NavigationSubform].    '<The default name of the
  7.                            new Acc2010 navigation control
  8.  
  9. [Form]!                 '<Tells us to look at 
  10.                              the form property of the
  11.                              navigation control, 
  12.                              in this case it 
  13.                              is the parent form: 
  14.                              frm_qry_asset_inventory_logbook
  15.  
  16. [sfm_qry_asset_inventory_logbook]! '< This is the subform of the 
  17.                              Currently loaded parent form
  18.  
  19. [history_fk_inventory]  '< and finally the 
  20.                              control of interest. <
So that got me to the control on the subform of the parentform loaded into the navigationcontrol.

What if we needed to get a control on the currently loaded form in the navigation control (we're still using the three afor mentioned forms here):
Expand|Select|Wrap|Line Numbers
  1. [Forms]![frm_navigation]![NavigationSubform].[Form]![Inventory_pk]
Note I did not use "frm_qry_asset_inventory_logbook"

In fact, if you clicked on a second button, and it loaded a new form (say frm_example2) with the bound control named "[example_pk]" then the reference to that control would be
Expand|Select|Wrap|Line Numbers
  1. [Forms]![frm_navigation]![NavigationSubform].[Form]![example_pk]
Clear as mud... was for me too.

Fourtunately however, when working within the loaded form; the "ME." construct holds true as does any of the references internally to the form using "Me." and the normal subform references (for example say:
in vba:
sfm_qry_asset_inventory_logbook
wanted to address the recordset for:
frm_qry_asset_inventory_logbook
(both of which are currently loaded into "NavigationSubform"

then the in vba code within "sfm_qry_asset_inventory_logbook" need only use the construct: Me.Parent.RecordSource and other constructs as shown in the link provided earlier.

-
Moveing data: there is, in the navigation control, the tab (button) that is associated with the form, a property, "Navigation Where Clause"
I've just started playing with this... taking the inventory forms... I have a tab that loads the inventory form... I already have a tab that has the history details... so I've been working with this property so one could select the item in the inventory pane and go directly to that item in the history side.
Nov 18 '13 #2
Thank you - very helpful. I get why it was not working now, you forced me to re-think my approach.

So I essentially just created a public function to get the value from the combobox on the main form (so it is always accessible to me). Then on each subform I just call the function and assign it to the field on the subform I am on using the Me! feature.

Sometimes approaching something in the opposite way to the way you are trying works :-)

@zmbd
Nov 18 '13 #3
I actually became a member of this site just to say thank you to zmdb!!
Finally something that can help me with this navigational crap!

Thanks!!
Apr 15 '15 #4
Neo001
1
@ZMBD I've been searching for this solution for daysss now, and was about to give up! thanks so much for the detailed solution. Wish u health strength and good deeds your way!
btw, I too created an account just to say thanks, lol
Sep 30 '15 #5
NeoPa
32,556 Expert Mod 16PB
It's very nice of both of you to take the time and effort to reply as you have. I know ZMBD will be thrilled when he sees this, and so he should be. He deserves it.
Oct 1 '15 #6
Lamar
1
Count me in as one creating an account to just say thank you.

Lamar
Jan 14 '19 #7

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

Similar topics

1
by: KY | last post by:
Hi, Is there any open source navigation control available for download that can be used for windows application? Please provide links if anyone knows. Thanks in advance, KY
0
by: Jane Hawkins | last post by:
Here's my basic need: 1. User clicks on a button 2. Button click event causes some additional controls to appear. 3. User is positioned at start of those additional controls when the page...
6
by: darrel | last post by:
I'm not a big fan of fly-out navigation, but I have a need for it on an internal application we're developing. Before I build my own, I thought I'd see what I could find. I found a lot of ..net...
1
by: bli2001 | last post by:
Hi All, it's not uncommon to have the main menu control on the left-hand side of a page and another menu across, say, the top of the page. Is it possible to have one navigation control...
2
by: MMA | last post by:
How do I populate the menu control in 2.0 from a database. I know this can be done with the Tree Control. Any code snippets? Thanks in advance.
4
by: clintonG | last post by:
Boy that's a helluva subject heh? But that's what I'm looking for. A navigation control that has a series of rectangles (each representing a star in the pattern) where each rectangle is connected...
1
by: Luke | last post by:
Scenario - There's a file called TEST.TXT Pagebreak characters in the TEXT.TXT will be used to split the content of text file into multiple pages. A Navigation control (...
1
yosiro
by: yosiro | last post by:
First, sorry for my english so bad. I want to create print button from a form that not working when i use navigation control. Step 1. http://i47.tinypic.com/2wp1d9e.jpg I want to print data...
2
by: RagonichaFulva | last post by:
Hello, I am trying to use your examples with a navigation form. It creates it, and I assume that the tab control is NavigationControl0, but Access 2010 says that it doesn't accept the method. ...
5
zmbd
by: zmbd | last post by:
Question first: Is there the equivalent ! that can be used in the form control’s recordsource parameter such as in a combo-box? Ok, now for some context: I’m Playing with the new “Navigation...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.