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

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 4147
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: subformPatientVisit. 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!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!cboVisit.SetFocus

To move from the main form to the first page of the tab control in the
subform:
Me!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).S etFocus

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

Me!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).S etFocus

Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).C ontrols("VisitDt").SetFocu
s

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

HTH -Linda
"Not Me" <no**********@da.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: subformPatientVisit. 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!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!cboVisit.SetFocus

To move from the main form to the first page of the tab control in the
subform:
Me!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).S etFocus

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

Me!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).S etFocus

Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).C ontrols("VisitDt").SetFocu
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 "txtUserPref" 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.Form!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.meganewss ervers.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: subformPatientVisit. 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!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!cboVisit.SetFocus

To move from the main form to the first page of the tab control in the
subform:
Me!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).S etFocus

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

Me!subformPatientVisit.SetFocus
Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).S etFocus

Me!subformPatientVisit.Form!TabCtlVisit.Pages(0).C ontrols("VisitDt").SetFocu
s

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

HTH -Linda
"Not Me" <no**********@da.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
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...
15
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,...
10
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>....
0
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
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....
3
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...
7
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...
0
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...
7
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...
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...
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
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...

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.