dbTalk Databases Forums  

Linking master child fields on a tabbed form

comp.databases.ms-access comp.databases.ms-access


Discuss Linking master child fields on a tabbed form in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Piotr Jaruga
 
Posts: n/a

Default Linking master child fields on a tabbed form - 11-23-2010 , 01:11 AM






Hey there, im stuck on a rather easy problem...well apparently not for
me.
I have a Main form (F_Main) wich has 2 tabs on it (Basic and
Additional) each of the tabs has a subform/subreport filed with
correspondingly inserted forms: F_basic and F_additional.
I woud like the Additional Tab to show me records that have the same
B_ID as the one shown in the Basic tab. I know how to do it when there
are no tabs but i seem to be stuck on the Master filed / child filed
syntax here...

Should it be:
child filed : B_ID (F_additional form is based on a Table which is
linked to the tbl_basic with B_ID filed - so that only ID's from
tbl_basic are added to tbl_additional)
master filed : F_Main.Basic.Fbasic!B_ID ??

I know that later ill have to do a requery on the Basic tab so that
the F_additional changes as well..so naturally if anyone could help me
with the VBA syntax as well.. on the on current event i would write:
Me.Parent![F_additional].requery should that do the trick?


Many thanks in advance since this little issue is testing my nerves...

Reply With Quote
  #2  
Old   
John Spencer
 
Posts: n/a

Default Re: Linking master child fields on a tabbed form - 11-23-2010 , 07:50 AM






Tabs have no effect on how you handle sub-form controls or any other controls
in a form. Tabs are simply organizational tools.

Setting up the Master/Child references can be tricky. Normally, you link from
data on the main form to the child sub-forms.

The way I handle this situation is to add an unbound control (invisible) to
the main form and then populate it with the linking value from the F_Basic
sub-form. Then I link F_Additional to that control's value.

The Unbound control's Control Source might read something like
=Me.F_Basic.Form.B_ID

That should change each time you change records in the F_Basic sub-form.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

On 11/23/2010 2:11 AM, Piotr Jaruga wrote:
Quote:
Hey there, im stuck on a rather easy problem...well apparently not for
me.
I have a Main form (F_Main) wich has 2 tabs on it (Basic and
Additional) each of the tabs has a subform/subreport filed with
correspondingly inserted forms: F_basic and F_additional.
I woud like the Additional Tab to show me records that have the same
B_ID as the one shown in the Basic tab. I know how to do it when there
are no tabs but i seem to be stuck on the Master filed / child filed
syntax here...

Should it be:
child filed : B_ID (F_additional form is based on a Table which is
linked to the tbl_basic with B_ID filed - so that only ID's from
tbl_basic are added to tbl_additional)
master filed : F_Main.Basic.Fbasic!B_ID ??

I know that later ill have to do a requery on the Basic tab so that
the F_additional changes as well..so naturally if anyone could help me
with the VBA syntax as well.. on the on current event i would write:
Me.Parent![F_additional].requery should that do the trick?


Many thanks in advance since this little issue is testing my nerves...

Reply With Quote
  #3  
Old   
Piotr Jaruga
 
Posts: n/a

Default Re: Linking master child fields on a tabbed form - 11-24-2010 , 12:14 AM



Hey John,
thanks for your quick reply. It turns out that (had to show my mdb to
a access specialist...) I had the wrong concept of a main form..I
wanted to treat it as a container without reference to any table and
the main form has to be linked with a table (or any record source) so
that the Master reference would know where to get its values.
The Idea with an invisible control sound really good and I think ill
give it a try.

I hope that my traumatic experience will help any future "Tabbed form
master/child linkers" and spare them the confusion

Thanks,
pj


On Nov 23, 2:50*pm, John Spencer <JSPEN... (AT) Hilltop (DOT) umbc> wrote:
Quote:
Tabs have no effect on how you handle sub-form controls or any other controls
in a form. *Tabs are simply organizational tools.

Setting up the Master/Child references can be tricky. *Normally, you link from
data on the main form to the child sub-forms.

The way I handle this situation is to add an unbound control (invisible) to
the main form and then populate it with the linking value from the F_Basic
sub-form. *Then I link F_Additional to that control's value.

The Unbound control's Control Source might read something like
=Me.F_Basic.Form.B_ID

That should change each time you change records in the F_Basic sub-form.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

On 11/23/2010 2:11 AM, Piotr Jaruga wrote:







Hey there, im stuck on a rather easy problem...well apparently not for
me.
I have a Main form (F_Main) wich has 2 tabs on it (Basic and
Additional) each of the tabs has a subform/subreport filed with
correspondingly inserted forms: F_basic and F_additional.
I woud like the Additional Tab to show me records that have the same
B_ID as the one shown in the Basic tab. I know how to do it when there
are no tabs but i seem to be stuck on the Master filed / child filed
syntax here...

Should it be:
child filed : B_ID (F_additional form is based on a Table which is
linked to the tbl_basic with B_ID filed - so that only ID's from
tbl_basic are added to tbl_additional)
master filed : F_Main.Basic.Fbasic!B_ID ??

I know that later ill have to do a requery on the Basic tab so that
the F_additional changes as well..so naturally if anyone could help me
with the VBA syntax as well.. on the on current event i would write:
Me.Parent![F_additional].requery should that do the trick?

Many thanks in advance since this little issue is testing my nerves...

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.