473,396 Members | 1,797 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,396 software developers and data experts.

Refreshing a Tabbed subform

Hi,

I have a Form that has a navigation subform (Horizontal tabs) which in turn has a navigation subform (vertical tabs) which in turn has a subform for use when that tab is selected. On that subform is another subform (based on a query)that lists accounts based on an as of date. The query uses the As of Date that is on the Base form when opened. The As of Date comes from another form where it is selected prior to opening frmBase. When the form (frmBase) opens (it is the first to appear), the subform is blank. However, when I select another tab and then return to it, the data appears. The forms are named:

frmBase - Holds the navigation form and the As of Date
NavigationSubform - Horizontal tabs for subforms
sfrmTOHBase - located on a vertical tab
sfrmList - located on the sfrmTOHBase

Interestingly, when looking at it in Expression builder it appears as Forms![frmBase]![NavigationSubform].Form![sfrmList]. It seems to skip over sfrmTOHBase.

So, in short, I'd like the results in sfrmList to appear when the form opens. Any help would be greatly appreciated as this has me stumped.

Thanks in advance.
Nov 9 '15 #1
4 1633
zmbd
5,501 Expert Mod 4TB
+The Navigation control introduced in ACC2010 is not a tabbed form.

+The "Tabs" as you call them are actually a specially grouped set of command buttons.

+ Each time you click on one of these buttons, the form associated with that button is loaded, new, fresh, reloaded. Any information that was previously contained in that form is either saved to the bound table, or lost.

What that means is that if, for example, the first button on the vertical set is clicked, entry is made in the controls on that form, then the third button on the horizontal row is clicked (or any button, including the originally selected button!), the values in the first form are either saved to the record or they are lost when the new form is loaded.

Now, you have a few options to pass information between forms:

- From a bound control, refer to the table... this of course supposes that the newly loaded form has a method of determining the correct record and field.
- Local variables (local to the parent form)
- Global variables
- Tempvars collection (which is growing on me)
- DoCmd.Browseto method

IN all but the last case, one has to use a On Load or On Open event and code to determine the passed value and act accordingly.

The last case, DoCmd.Browseto method, can be used to pass a WhereCondition to the form that is being "browsed to" that filters the form's bound recordset.

For a bit more information about the NavigationFormControl see my post here: https://bytes.com/topic/access/answe...s#post3760995"
-- I am working on an insights article based on this very post :)

+ There is also a known bug in the navigation control that if the control group uses more than one set of command buttons and the parent form has VBA associated with it that the form will crash when opened using a split front-end/back-end database.
Nov 9 '15 #2
Thank you. That's helpful information. I had no idea that the navigation subform is a set of grouped buttons. It has helped put me on a better path for the answer.

However, I'm still lost on how to get the data on the first form to appear without having to first click on another tab and then return to the first one. What you provided did help me search further but I have to admit I'm somewhat of a novice on the VBA side.

Any further guidance that you could provide would be deeply appreciated.

Thank you.
Nov 9 '15 #3
ZMBD, the information that you provided on the Navigation Control was extremely helpful. I was looking in the wrong places. Thank you.

I used that as a jumping off point to dig deeper and am finding that there doesn't appear to be an easy (or apparent) solution to having the first form appear with data on the Navigation Control.

So in the interest of helping others with the same issue, as a temporary solution, I took the easy way and just created a message form to come up on the first tab explaining to users how to select data. The remaining tabs display the data when selected as they should.

Not the best solution, but to a user, it's better than having a blank form appear. And in the mean time I'll keep on looking.

Thanks again.
Nov 10 '15 #4
zmbd
5,501 Expert Mod 4TB
Q1) Ok, re-reading your post, is the following correct:
+ Parent form with NavigationFormControl named FrmBase with horizontal navigation buttons. Therein also resides a control named [AsOfDate]

+ Child form with NavigationFormControl named ??? with vertical navigation buttons
this would be a second form with a second NavigationFormControl not the NavigationFormControl formatted to have two sets of navigation buttons created by: Ribbon>Create>Forms>Navigation_Menu>{Horizontal Tabs and Vertical Tabs (Left/Right)}
+ GrandChild form assigned to load when the Child form's vertical navigation button is clicked on.

You have a query along the following lines - that is the record source for the grandchild:
Expand|Select|Wrap|Line Numbers
  1. SELECT [PK], [Field_Date]
  2. FROM [DataTable]
  3. WHERE ( [DataTable]![Field_Date] =
  4.    [Forms]![FrmBase]![AsOfDate]);
So when you click on the vertical button of the Child form you wish for the Grandchild to load the current record set based on the query returning only those records with the matching date as entered in the [AsOfDate] control on the parent.

There is no On_load or On_Open VBA nor Macro code in the GrandChild form that would clear a filter or other such actions in any of the other forms related to, or acting on, this subform.

Q2) With all tables, forms, reports, and other queries closed, open the Grandchild form, what happens?

Q3) With all tables, forms, reports, and other queries closed, open the query that is the record source for the Grandchild, what happens?

Q4) With all tables, forms, reports, and other queries closed, Open the parent form in design mode. Show the properties for the vertical tab on the Child Navigation, or that the tab that is designated to open the Grandchild.
  • In the data-tab what are the values for the following properties
    Q4a) Navigation Target Name
    Q4b) Navigation Where Clause
    Q4c) Enabled
  • In the All-Tab
    Q4d) Name
  • In the Event-Tab
    Q4e)any entries for any property
Nov 10 '15 #5

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

Similar topics

3
by: Steve Miles | last post by:
I've got a tabbed form with the 2nd tab containing a subform. I'm trying to avoid the need to use the mouse to set focus to the first field on the subform. I can use <CTRL><TAB> to open the 2nd...
2
by: Brian Keanie | last post by:
Is it possible to set different colours to each tab in a tabbed subform?
1
by: jen | last post by:
I have a Field - Project, and my subform data is based on that field. When I change this field, I need my subform to refresh. I'm trying to do a requery on the change of the project field, but it...
3
by: ken | last post by:
Hi, I have a main form with a text box and a filter button. I also have a subform in the main form. When I make an entry into the filter text box and click the filter button, I change the query...
3
by: kev | last post by:
Hello, I posted a question a while ago on tabbed pages, how to set it to invisible when the text box is empty.It was answered by Rick and the code ran perfectly. However, i tried using the same...
11
by: AndyM | last post by:
Hi, I have a curious problem that is causing me large amounts of grief and is steadily turning me grey. Hopefully you guys can help. I have a Master table that contains a CustomerID (as well as...
14
Ericks
by: Ericks | last post by:
Setting focus is addressed through several questions on this forum but I find this so complicated that I need a taylormade answer. I have a tabbed main form called "Compounds". On one of the tabs,...
1
by: Henry Stockbridge | last post by:
Hi, I have a main form (bio info) with a tab control containing three pages (employment, financial and dependent, respectively.) When I move record to record on the main form, the correct...
3
by: DeanO | last post by:
I have a new problem I have a Form with three tabs. I want the third tab to open auto when a text box on the first tabbed subform is updated. I have tried the SetFocus event but this will not work,...
6
by: jaad | last post by:
I use a popup form to write the "ToDo" portion of a record. Once I close the popup form I would like !!.!. to be refreshed with the new information that I just wrote in the popup form that I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.