Subforms within a Tab control

J

jo

Hi,all
I have a main form called” MainLayout” and I am trying to fit 2 subforms on
one tab of a tab control, the tab is called “TabForm” one of the subforms is
called “CMP” the other one is called “TK” the TK subform is situated
beneath the “CMP” subform but needs to react as if it was nested in the
“CMP” subform.
When I have experimented with a main form and two subforms I used a text
box in the header of the main form named “link” and in the above example
used the following code within the current event of the” CMP” form
:parent.link =me.CpID and in the TK subform configured the Linkmaster as
“Link” and the link child as CPID.
However I need some advice in how I restructure the above so I can get my
subforms to work within a tab environment
 
J

John W. Vinson

Hi,all
I have a main form called” MainLayout” and I am trying to fit 2 subforms on
one tab of a tab control, the tab is called “TabForm” one of the subforms is
called “CMP” the other one is called “TK” the TK subform is situated
beneath the “CMP” subform but needs to react as if it was nested in the
“CMP” subform.
When I have experimented with a main form and two subforms I used a text
box in the header of the main form named “link” and in the above example
used the following code within the current event of the” CMP” form
:parent.link =me.CpID and in the TK subform configured the Linkmaster as
“Link” and the link child as CPID.
However I need some advice in how I restructure the above so I can get my
subforms to work within a tab environment

Exactly the same. The tab is purely for screen real estate management; it
doesn't affect how you reference the subforms or other controls in the
slightest.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
J

jo

Thank you for the reply, what I should have included in my post was the
following when discussing my experimenting with a form /two subforms
I can synchronise the two subform by using a text box and the code in the
current event.
However I need to place “Parent.link =me.CpID “ in the Form_BeforeUpdate
event as well as the current form event, as without the additional code, no
value is written in the foreign key field of the TK table.
Following your comments I have used the above code within the form /tab
control set-up and looks like its working.
Am I covering up an issue with my relationship structure or do I need the
extra code?
Is there an alternative method to achieve my requirement?
 
J

John W. Vinson

Thank you for the reply, what I should have included in my post was the
following when discussing my experimenting with a form /two subforms
I can synchronise the two subform by using a text box and the code in the
current event.
However I need to place “Parent.link =me.CpID “ in the Form_BeforeUpdate
event as well as the current form event, as without the additional code, no
value is written in the foreign key field of the TK table.
Following your comments I have used the above code within the form /tab
control set-up and looks like its working.
Am I covering up an issue with my relationship structure or do I need the
extra code?
Is there an alternative method to achieve my requirement?

Since you haven't posted your code, the recordsources of your form, or a clear
description of your requirement, all I can say is "I have no idea".
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
J

jo

As requested background on my test example I am designing for Access 2003
that uses 3 tables, 1 form with 2 subforms.
Table 1 named as ZA_Data PK=ZA_ID
Table 2 Named as CMP_Data PK= CMP_ID FK=ZA_ID
Table 3 Named as TK_Data Pk=TK_ID FK=CMP_ID
All have a relationship as one- to -many
Have enforce referential integrity
Cascade update related fields
And Delete related fields options set.
With Join properties option 1 set
3 forms
Za_Data : being used as the main form RS= table 1CMP_data: being used as a subform placed on main form
Subform set-up as per:
Name: CMP_Data
SO: CMP_data
LCF:ZA_ID
LMF:ZA_IDTK-data: being used as a subform placed on main form next to the above
subform. Needs to act as if it was nested with above subform
Subform set-up as per:
Name: TK_Data
SO: TK_data
LCF:CMP_ID
LMF: LINK
A Text box has been placed within main form header Named “ Link”
Thank you for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top