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