Good day all,
Can anyone enlighten me on how to switch between tabs in navigation form? My navigation form has 5 tabs, and for some reasons I need a code to switch, between those tabs.
I have searched the web, but unfortunately nothing worked out.
Thanks
16 39955 NeoPa 32,557
Recognized Expert Moderator MVP
I don't use tabs (or Pages) much, but I suggest you do select a control found on it to switch to it. Like Sections, I'm not aware of any way to switch focus to them directly (without selecting a specific control on them).
Thanks so much for your response; I appreciate your suggestion. However, can you tell me how to do select control found or how to implement your suggestion ?
Any idea will be much appreciateled
NeoPa 32,557
Recognized Expert Moderator MVP
Rather than spelling out the details in the answer, that you should include in the question, I'll wait for some sensible details and reply using those if you don't mind. It's not fun working blind at the best of times, but completely blind because you haven't included any details in your question is not how things should be ;-)
Thanks Neopa for you kind support. Yes, you are totally right; I should have included more details.
Well, as stated in my first post I have a navigation form that has 5 tabs. The navigation form’s name is "ManageProfiles", and the tabs' names in order are:
1-EmployeesProfile
2-EvaluatorsProfile
3-MentorsProfile
4-Registration
5-WorkingSchedule
On clicking on WorkingSchedule tab, I navigate to the "WorkingSchedule Form" which is embedded in the navigation subform. It allows the user to see the schedule of each employee and their courses as well. Now, I need to write a code so when user clicks on a certain course, it switched directly to the Registration Tab, and filter through the records to bring up that particular course to allow the user to change the date.
The question now is how to switch to Registration tab?
Thanks in advance
NeoPa 32,557
Recognized Expert Moderator MVP
Much better, BUT...
If you want code to switch to the [Registration] tab, then you need to include the name of a control that is found on that tab. A SubForm control is fine, but whichever control you choose will be selected when the switch is made.
You also need to include details of what it is that will trigger the code to run. If that is a click somewhere, then the name of the somewhere must also be included. It's a good idea to indicate names within []. It's not always necessary, but it does indicate clearly what is actually the name and what is part of your text.
- TabControlName.Pages("VBA_PageName").SetFocus
or, using pages indexes, - TabControlName.Value = IndexValue
Neopa Thanks for your usual support. I have tried all methods of finding a control on the [Registration] tabs, but nothing worked out. Luckly, while searching the web, I found a post in a forum similar to my case. I found out that the way to switch from one tab to another in "Navigation Forms" is to change the SourceObject of the Subform Control. So, the code to carry out this task is: - Forms![ManageProfiles].[SubNavigation].SourceObject = "EmployeesCourses"
Note: [EmployeesCourses] is the form embeded in Subform Control of Navigation Form.
Again, Thanks for your help
Mihail, Thanks for your inputs. I believe your codes would work with on forms based on Tab Control, but not with navigation forms.
Thanks all
NeoPa 32,557
Recognized Expert Moderator MVP
I'm confused. Your solution doesn't fit the question at all as far as I can see.
I guess (from what you have now included in your answer) that the subform control found on the tab (Page) in question is actually called [SubNavigation] (My question #1). As such, my answer would have been (due to the lack of an answer to question #2 I can't illustrate this in context) : - Call Me.SubNavigation.SetFocus()
It may well be that Mihail's answer, if it works, is actually a better one anyway. I was under the impression that Tab controls could not be selected directly. Possibly I was confusing this with the fact that a reference to a control within a Tab doesn't need any reference to the Tab's name in it.
If, as seems possible now, you were really after a way of changing the form that's shown within a subform on your main form, then your solution should be : - Me.SubNavigation.SourceObject = "EmployeesCourses"
Try This: -
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
-
ObjectName:="EventDS", _
-
PathToSubformControl:="Main.NavigationSubform", _
-
WhereCondition:="", _
-
Page:="", _
-
DataMode:=acFormEdit
zmbd 5,501
Recognized Expert Moderator Expert
Just because this thread popped up:
A few other threads about this control - for those that come across this thread - dealing with a few different issues: - Me!NavigationSubform.SourceObject = "FORM NAME"
FORM NAME = the page you want to open in the subform area of the Navigation form
zmbd 5,501
Recognized Expert Moderator Expert
kcbehnet Me!NavigationSubform.SourceObject = "FORM NAME"
kcbehnet
You will find that only works {as expected} in a tabbed form control {the code in an ACC2010 navctrl results in a fresh reload of the subform; thus the info in the prior form is lost an as writen doesn't work from within the subform}
This will not work in the new ACC2010/newer NavigationForm Control {as one would expect. The original question was modified in post #5}
The way to move from one NavigationFormControl-tab to the other {and have the data filted as requested in post #5} is to use the "DoCmd.BrowseTo" method.
Please refer to the links as provided in my prior post for more detail about the newer ACC2010/newer NavigationForm Controls. (^_^)
twinnyfo 3,653
Recognized Expert Moderator Specialist
Z, et al,
For this reason, I started this thread: Is there any Value in NAvigation Forms?
I originally thought about posting a response to this thread, but began a new one.
Z, for you to have been frustrated understanding the new Nav Forms, I know they are not for me! I'm happy loading all my subforms at once into a Tab Control and being able to keep all my data!
:-)
I place the following code in the Form_Load event of the Navigation form and it works. - Me!NavigationSubform.SourceObject = "FORM NAME"
As mentioned, I have two Navigation Controls, "NavigationControTop" and "NavigationControLeft". I am not sure if this is a tabbed form or normal navigation form as it is created automatically by selecting the Navigation Form Wizard.
I am sure I can solve the issue by means of one of the two following method:
First: if I can manage to activate the selected Navigation button in the "NavigationContyroTop".
or
Second: If I can know how to refer to the five respective groups in the "NavigationControLeft" control, with respect to the five navigation buttons in the "NavigationControTop" control.
zmbd 5,501
Recognized Expert Moderator Expert
kcbehnet:
1) Well, if you used the wizard, then you most likely have the "Navigation Control"
2) Which version of access are you using?
3) Your solution of Me!NavigationSubform.SourceObject = "FORM NAME" does work as a solution to the original question as posted in #1 - provided the controls are on the main form or in the main form events.
4) I should have been clearer in reply (I will fix that after this post}:
The original question was modified in post #5(which I most likely should merge with post number one).
Your solution is already profered in post #8; however this shows the full form reference for a control within the subform and could have been shortened to: Parent!NavigationSubform.SourceObject = "FORM NAME"
However, this code does not answer the modified question from post #5 which was to be able to pass information from one form to the next during loading of the next form. Post 11 by "Israel h" provided the solution that allows one to easily switch navigation control tabs and pass information between them.
5) You will find issues having VBA code in the main form of a navigation form. Especially if you are using a multi-tiered form (which it sounds as if you are) as demonstrated in this thread: http://bytes.com/topic/access/answer...nt-tab-clicked
This is a known bug in ACC2010 and has not been fixed as of yet for this version. I suspect that ACC2013 suffers from this as well.
6) You will need to start your own thread for what apears to be the questions about navigating to the secondary controls.
6a) Post 11 has one answer to your questions.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Adlai Stevenson |
last post by:
For a Windows Form app, that consumes a web service.
I want the option of being able to run this as a scheduled job in a
batch mode.
The app ( which I call XMailMan) form has two controls, a...
|
by: Simon Pleasants |
last post by:
Am something of a newbie at this, so please bear with any stupid
questions.
I have created a database to track shipments that we import. The
information is stored in a table and I have created...
|
by: vanvee |
last post by:
Hi
I have an application for my company's HR department where we store
resumes for candidates we receive. I have an application that uses
VB.Net and ADO.Net and data bindings (through code) to...
|
by: Philip Wagenaar |
last post by:
I have made a form with a tab that containts groupboxes and those contain
checkboxes.
When I run the application sometimes the outlining for some groupboxes are
not shown, if I switch tabs and...
|
by: Jeff Waskiewicz |
last post by:
Here is what I am trying to accomplish. I have an MDI application on the
left side of the client area I have a borderless form that holds a treeveiw
for navigation. When an item is selected from...
| |
by: pbd22 |
last post by:
Hi.
I am building a bit of a "learn-as-you-go" web site.
I have tabs that change based on what page the
user is on. The problem is, I have been using a
javascript doOnLoad function to recognize...
|
by: Phil Reynolds |
last post by:
I'm using a tab control in Access 2000, and the user requested to have
buttons in the form header, instead of the built-in tabs (so that when they
scroll down, they can still switch tabs). Now,...
|
by: NoaD |
last post by:
Hello i have a button that clicking on it should open a pop-up with a calendar.
I'm working with IE 7.
the behaviour that follows clicking on the button is not persistent.
if i use the mouse...
|
by: AdamOnAccess |
last post by:
Anyone know an easy way to toggle between Form and Design view with a hotkey?
I know you can switch from Design view to Form view with hotkey F5. But is there a hotkey to switch back (from Form...
|
by: araman |
last post by:
Hello,
I have a form and subform . The Main form contains four boxes to enter criteria for the query that fills the subform. Outside of the navigation form it works great. when i add it to the...
|
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,...
| |
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: 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,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |