Solved

Access 2010 Code to Reference Navigation Form

Posted on 2014-01-02
10
2,146 Views
Last Modified: 2014-01-26
Hello Experts.

I have the following reference code that works on a form created with several subforms attached.

Forms![frm_PremierProductLaunchPlanner]![frm_PremierProductLaunchPlanner_SubFrm_FDB].Form!txtSearchBrandName = Null

Or

[Forms]![MainForm]![SubForm].Form![Control] = Null

I wanted to clean up the look of the database, so I created a Navigation form and placed all the forms onto the new Navigation form.

How do I reference the Navigation form in the above code to get it working again?

Thank in advance for your help.
David
0
Comment
Question by:dhemple
  • 6
  • 4
10 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39751437
you will use this command to view "FormX"

DoCmd.BrowseTo acBrowseToForm, "FormX", "Navigation Form1.NavigationSubForm"
0
 

Author Comment

by:dhemple
ID: 39751459
Hello capricorn and thank you for your response.

I'm a bit confused with your response.  It doesn't take much for me.

I was looking for a code change to my original working code that would include the new navigation form that I dropped all other forms/subforms onto.

I tried things like

Forms![NavigationForm]![frm_PremierProductLaunchPlanner]![frm_PremierProductLaunchPlanner_SubFrm_FDB].Form!txtSearchBrandName = Null

but this does not work.  I have other code within the form where I would have to make similar changes.  Any ideas on how to get the existing code to work with newly created navigation form?

Thanks
0
 

Author Comment

by:dhemple
ID: 39751598
More points.  I'm in a time crunch.  Anyone?
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39751607
<I was looking for a code change to my original working code that would include the new navigation form that I dropped all other forms/subforms onto.>

the code i posted above will do it.

what is the name given to your navigation form?
0
 

Author Comment

by:dhemple
ID: 39751613
Navigation form name is "MainMenu"
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39751642
try this, to view form "frm_PremierProductLaunchPlanner"


DoCmd.BrowseTo acBrowseToForm, "frm_PremierProductLaunchPlanner", "MainMenu.NavigationSubForm"


.
0
 

Author Comment

by:dhemple
ID: 39751683
capricorn,

Thanks for your responses and trying to help me, but I'm not seeing how this is going to help me.

I'm not trying to view a form on the navigation form, I'm trying to reference a control within the navigation's forms, subform, subform to be used else where.

Is there any way to reference the navigation form [MainMenu] in the code below so that I can reset the value of control to NULL?

Forms![frm_PremierProductLaunchPlanner]![frm_PremierProductLaunchPlanner_SubFrm_FDB].Form!txtSearchBrandName = Null

As I mentioned, I have other code simular to this that I'll need to change so that it properly references the navigation form.

Any thoughts on how to reference properly?
0
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 250 total points
ID: 39751693
<Thanks for your responses and trying to help me, but I'm not seeing how this is going to help me.>

i am trying to show you how to navigate to forms that are inside the Navigation Form, that is the first step to navigate thru the controls inside the forms/subforms.

better see this link for reference

http://msdn.microsoft.com/en-us/library/office/ff196381.aspx
0
 

Accepted Solution

by:
dhemple earned 0 total points
ID: 39751914
I found the answer I was looking for.

When I created the Navigation form and named it [MainMenu], I was only referencing form [MainMenu] and the subforms that I pulled into this form within my code.  What I failed to realize was that when I created the Navigation form it created a subform within it called [NavigationSubform].

Form Hierarchy:
NavigationForm  = MainMenu
NavigationSubform
Subform2  = [frm_PremierProductLaunchPlanner]
Subform3 (within subform2) = [frm_PremierProductLaunchPlanner_SubFrm_FDB]

I also found when referencing a control within Subform3, I don’t have to reference Subform2.  I believe this is because the Navigation form sees Subform2 and Subform3 as individual forms and not within one another.

Here’s the code that will work

Forms![NavigationForm].Form![NavigationSubform].Form![Subform3]![Control]

Thanks for trying to help with my question.
0
 

Author Closing Comment

by:dhemple
ID: 39809815
my solution spells it out
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now