473,569 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tab control.. hierarchies and the like.

Hi,

Just trying to get my head around tab controls, is there anywhere which
would describe the structure of how they work? I seem to be ok so far,
being able to check which page I'm on etc... but I'm at a loss when
trying to access controls inside the tabs.

If I try to access the form directly ([forms]!...etc.) I get an error
that the form can't be found. I'm not sure how I can use parent/child
relationships to get at the (sub)forms which are on the tabs... any clues?

Also, which (if any) events are ran when changing between tabs? I know
the tab change event is one, but do any of the subforms (on the tab
page) have any events which occur, such as focus/load/open/activate?

Any help would be greatly appreciated!
Cheers,
Chris
Nov 13 '05 #1
3 4164
Hi,

I'm using a tab control so let me show you some of the code and maybe this
will help.

I have a main form: frmPatient and a subform: subformPatientV isit. On the
subform I have a
tab control called: TabCtlVisit.

frmPatient's recordsource is tblDemographics , primary key DemoID.
subform's recordsource is tblVisit, primary key VisitID, foreign key DemoID.
So in the properties dialog for the subform: Link Child Fields/Link Master
Fields is set
to DemoID.

I will put subforms on the tabbed pages and they will be child tables of the
Visit table,
e.g. for the patient's Echo test, primary key EchoID, foreign key VisitID
and set the
Link Child Fields/Link Master Fields to VisitID.

I currently have this code in place to access the controls on the tab
control:

To move from the main form to a combobox on the subform:
Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!cb oVisit.SetFocus

To move from the main form to the first page of the tab control in the
subform:
Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).SetFocus

To move to a specific control on the tabbed page (I needed all the lines of
code to make
this work...)

Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).SetFocus

Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).Controls("V isitDt").SetFoc u
s

Look at the properties dialog for the subform - it has all the events any
form would have.

HTH -Linda
"Not Me" <no**********@d a.com.uk.hk.org > wrote in message
news:co******** **@ucsnew1.ncl. ac.uk...
Hi,

Just trying to get my head around tab controls, is there anywhere which
would describe the structure of how they work? I seem to be ok so far,
being able to check which page I'm on etc... but I'm at a loss when
trying to access controls inside the tabs.

If I try to access the form directly ([forms]!...etc.) I get an error
that the form can't be found. I'm not sure how I can use parent/child
relationships to get at the (sub)forms which are on the tabs... any clues?

Also, which (if any) events are ran when changing between tabs? I know
the tab change event is one, but do any of the subforms (on the tab
page) have any events which occur, such as focus/load/open/activate?

Any help would be greatly appreciated!
Cheers,
Chris

Nov 13 '05 #2
Squirrel wrote:
Hi,

I'm using a tab control so let me show you some of the code and maybe this
will help.

I have a main form: frmPatient and a subform: subformPatientV isit. On the
subform I have a
tab control called: TabCtlVisit.

frmPatient's recordsource is tblDemographics , primary key DemoID.
subform's recordsource is tblVisit, primary key VisitID, foreign key DemoID.
So in the properties dialog for the subform: Link Child Fields/Link Master
Fields is set
to DemoID.

I will put subforms on the tabbed pages and they will be child tables of the
Visit table,
e.g. for the patient's Echo test, primary key EchoID, foreign key VisitID
and set the
Link Child Fields/Link Master Fields to VisitID.

I currently have this code in place to access the controls on the tab
control:

To move from the main form to a combobox on the subform:
Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!cb oVisit.SetFocus

To move from the main form to the first page of the tab control in the
subform:
Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).SetFocus

To move to a specific control on the tabbed page (I needed all the lines of
code to make
this work...)

Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).SetFocus

Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).Controls("V isitDt").SetFoc u
s

Look at the properties dialog for the subform - it has all the events any
form would have.

HTH -Linda


Thanks for all that linda, I think my understanding is improving.. tho
I'll give it a few more reads over just to be sure :)

Cheers,
Chris
Nov 13 '05 #3
Linda,
Correct me if I am wrong, but I believe you are referring to a Tab Control
set on a Subform on the parent form... which is a level deeper than the
current
question Chris posed.
I believe Chris has a subform on a Tab control on the parent form...
To reference any control on a tab control, just reference the control as if
there were no tab control.
Say I had a field "txtUserPre f" on Tab Page 2.
From within the form I would use:
Me!txtUserPref
From another form or other code module:
Forms!frmMyForm !txtUserPref
The Tab is strictly a "visible" layout control, and does not affect
hierarchy. Although you may access controls by also referrencing their page,
you don't have to.
To reference a control on Subform on a Tab control:
Me!MySubform.Fo rm!txtUserPref
or
Forms!frmMyForm !MySubform.Form !txtUserPref

Remember that Subforms are accessed by the name you gave the Subform
control, NOT by the name of the form that resides in the Subform control.
The control does not have to be on the visible Tab Page to be manipulated.

HTH.
~ Duane Phillips.
"Squirrel" <wi*****@covad. net> wrote in message
news:b8******** *************** ****@msgid.mega newsservers.com ...
Hi,

I'm using a tab control so let me show you some of the code and maybe this
will help.

I have a main form: frmPatient and a subform: subformPatientV isit. On the
subform I have a
tab control called: TabCtlVisit.

frmPatient's recordsource is tblDemographics , primary key DemoID.
subform's recordsource is tblVisit, primary key VisitID, foreign key
DemoID.
So in the properties dialog for the subform: Link Child Fields/Link Master
Fields is set
to DemoID.

I will put subforms on the tabbed pages and they will be child tables of
the
Visit table,
e.g. for the patient's Echo test, primary key EchoID, foreign key VisitID
and set the
Link Child Fields/Link Master Fields to VisitID.

I currently have this code in place to access the controls on the tab
control:

To move from the main form to a combobox on the subform:
Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!cb oVisit.SetFocus

To move from the main form to the first page of the tab control in the
subform:
Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).SetFocus

To move to a specific control on the tabbed page (I needed all the lines
of
code to make
this work...)

Me!subformPatie ntVisit.SetFocu s
Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).SetFocus

Me!subformPatie ntVisit.Form!Ta bCtlVisit.Pages (0).Controls("V isitDt").SetFoc u
s

Look at the properties dialog for the subform - it has all the events any
form would have.

HTH -Linda
"Not Me" <no**********@d a.com.uk.hk.org > wrote in message
news:co******** **@ucsnew1.ncl. ac.uk...
Hi,

Just trying to get my head around tab controls, is there anywhere which
would describe the structure of how they work? I seem to be ok so far,
being able to check which page I'm on etc... but I'm at a loss when
trying to access controls inside the tabs.

If I try to access the form directly ([forms]!...etc.) I get an error
that the form can't be found. I'm not sure how I can use parent/child
relationships to get at the (sub)forms which are on the tabs... any
clues?

Also, which (if any) events are ran when changing between tabs? I know
the tab change event is one, but do any of the subforms (on the tab
page) have any events which occur, such as focus/load/open/activate?

Any help would be greatly appreciated!
Cheers,
Chris



Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
1500
by: Chris Cioffi | last post by:
Hello all! I'm trying to subclass int such that once it reaches a certain value, it flips back to the starting count. This is for use as an X12 control number. Subclassing int and getting the display like I want it was trivial, however what's the best way to make it such that: 990 + 1 = 991 991 + 1 = 992 .... 998 + 1 = 999
15
8854
by: Robert Brown | last post by:
Is there a good approach to modelling many heterogeneous entity types with that have some attributes in common? Say I have entities "employees" which share some attibutes (e.g. firstname, lastname, dateofbirth) but some subsets of employees (e.g. physicians, janitors, nurses, ambulance drivers) may have additional attributes that do not...
10
1973
by: Harlan Messinger | last post by:
Different pages on a web site can vary in the level of header to which they descend. One short page may have only <h1>, or <h1> and <h2>. Another, detailed page, might get all the way down to <h6>. Maybe the site's page also display common sidebars with their own hierarchies, such as "In the News" block divided into two or three sections...
0
1505
by: . | last post by:
comp.infosystems.www.authoring.html,news.admin.hierarchies,comp.bugs.misc,comp.os.ms-windows.programmer.networks,comp.os.os2.bugs
0
1136
by: Liet Kynes | last post by:
I'm new to the .NET security framework, and I pose the following questions: 1) According to the documentation I've read .NET is promoting a role-based security model centered around IPrincipal. What about granular user-based security requirements? For example: I'm building a file repository app that allows users to upload files to the...
3
1181
by: Claes Rådström | last post by:
Hi ! We have a base class that derives from System.Web.UI.Page Alla our pages derives from it. In our base class we want to have an access check, (own) , to verfy user access to the derived page. We want this in the base class so that the programmer cant forget to implement it. => we want a page load in the base class to fire first, if...
7
1507
by: Stoyan Stratev | last post by:
I have a control whose ClientID is used in a number of Javascript routines. It turned out that the ClientID has a dash (-) in it and breaks the JS. Is there a way to change the ClientID of that control?
0
937
by: Shem | last post by:
Hi Folks, I have read the article Tree Hierarchies in SQL and was wondering if anyone has also read this and implemented it in the new menu control. I am also trying to implement it in such a way that there is more than one root node displayed from the outset. I can do this bwhen creating a static menu, but not quite sure how to do this...
7
2307
by: Charles D Hixson | last post by:
I'm sure I've read before about how to construct prototypes in Python, but I haven't been able to track it down (or figure it out). What I basically want is a kind of class that has both class and instance level dict variables, such that descendant classes automatically create their own class and instance level dict variables. The idea is...
0
7695
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
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 we have to send another system
0
936
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.