473,386 Members | 1,673 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.

2 subforms on a form



Hi all

Is it possible to have 2 subforms on a form but have the second subform
linked to the 1st subform. I will explain the situation.

My form contains details of teams and the shift the team is working on a
particular day. The 1st subform contains the names of the team members.
As the user moves through the records on the main form, the team members
are updated accordingly. The 1st subform is a continuous form.

I want the second subform to show any absences for the team member
selected in the 1st subform.

I think you are all going to tell me that the 2nd subform should be a
subform of the 1st subform. However, when i tried that i got a message
saying this was not possible with a continuous form. The reason i want
the 1st subform as a continuous form is because i want the user to be
able to select more than one team member at a time and add an absence or
shift change - rather than having to do this one team member at a time.

Hope this makes sense and would be grateful for any help.

thanks
michelle

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
5 3507
Hi Michelle,

There's a trick that works really well. On Subform 2, set the 'Link Child
Fields' property to the field name on the subform you're using as a link.
Now set the 'Link parent Fields' property to point to the field in Subform 1
that forms the link.
e.g.
Link Child Fields...Subform2_FieldName
Link Parent
Fields...Forms!frmMainFormName!subForm1SubformCont rolName.Form!Subform1_Fiel
dName

Note the syntax: Forms!<Main>!<SubFormControl>!Form!<FieldName> where
anything in angle brackets is a name you've given to the item in question.

All the best,

Andrew

"Michelle" <mi*************@poferries.com_NOSPAM> wrote in message
news:40*********************@news.frii.net...


Hi all

Is it possible to have 2 subforms on a form but have the second subform
linked to the 1st subform. I will explain the situation.

My form contains details of teams and the shift the team is working on a
particular day. The 1st subform contains the names of the team members.
As the user moves through the records on the main form, the team members
are updated accordingly. The 1st subform is a continuous form.

I want the second subform to show any absences for the team member
selected in the 1st subform.

I think you are all going to tell me that the 2nd subform should be a
subform of the 1st subform. However, when i tried that i got a message
saying this was not possible with a continuous form. The reason i want
the 1st subform as a continuous form is because i want the user to be
able to select more than one team member at a time and add an absence or
shift change - rather than having to do this one team member at a time.

Hope this makes sense and would be grateful for any help.

thanks
michelle

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2

Hi Andrew
Thanks for your help.

However, i can't seem to get the 2 subforms to synchronise. Do you
think that this is because the first subform is a continuous form.

regards
michelle
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
No, because it works for me. But, you will need to requery the second
subform in the Activate event of the main form, and in the OnCurrent event
of the Form embedded in the first Subform control.

In the main form's Activate event, mine is:

Me.sbfWorkerAbsences.Requery

In the first subform's OnCurrent, mine is:

Me.Parent!sbfWorkerAbsences.Requery

It doesn't synchronize automatically with a change in the first subform; the
automatic synchronization is limited to a change in the parent of a given
subform, but you can force it to use something else -- as was suggested
here.

Larry Linson
Microsoft Access MVP

"Michelle" <mi*************@poferries.com_NOSPAM> wrote in message
news:40*********************@news.frii.net...

Hi Andrew
Thanks for your help.

However, i can't seem to get the 2 subforms to synchronise. Do you
think that this is because the first subform is a continuous form.

regards
michelle
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4
Thanks for catching that, Larry!

All the best,
Andrew

"Larry Linson" <bo*****@localhost.not> wrote in message
news:nY******************@nwrddc03.gnilink.net...
No, because it works for me. But, you will need to requery the second
subform in the Activate event of the main form, and in the OnCurrent event
of the Form embedded in the first Subform control.

In the main form's Activate event, mine is:

Me.sbfWorkerAbsences.Requery

In the first subform's OnCurrent, mine is:

Me.Parent!sbfWorkerAbsences.Requery

It doesn't synchronize automatically with a change in the first subform; the automatic synchronization is limited to a change in the parent of a given
subform, but you can force it to use something else -- as was suggested
here.

Larry Linson
Microsoft Access MVP

"Michelle" <mi*************@poferries.com_NOSPAM> wrote in message
news:40*********************@news.frii.net...

Hi Andrew
Thanks for your help.

However, i can't seem to get the 2 subforms to synchronise. Do you
think that this is because the first subform is a continuous form.

regards
michelle
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #5
Michelle <mi*************@poferries.com_NOSPAM> wrote in
news:40*********************@news.frii.net:

Hi Andrew
Thanks for your help.

However, i can't seem to get the 2 subforms to synchronise.
Do you think that this is because the first subform is a
continuous form.

regards
michelle


The way I set up synchronization of two subforms is to create a
hidden textbox on the parent form. In the Current Event of the
subform, put the subform key into this hidden textbox.
For the second subform, set it's parent link field to the hidden
textbox. Access handles the requery for you. Unfortunately, you
won't be able to update a sickday for two team members at the same
time, but you can do the one after the other.

Bob Q
Nov 12 '05 #6

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

Similar topics

1
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various...
2
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms...
0
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't...
7
by: lauren quantrell | last post by:
A while back I got a requirement for the client to be able to adjust the relative heights of two subforms by click-dragging the mouse and I came up with a kludge solution using a border control...
4
by: microb0x | last post by:
I have an application with a master form with a tab control containing nine tabs, each tab contains a subform. I have command buttons on my main form including: Save , Cancel , Close. My...
2
by: robert.waters | last post by:
Hello, If I have a form containing a Tab Control with N pages, each page containing a subform, are those subforms loaded into memory when another page has the focus? I have tried iterating...
1
by: Ecohouse | last post by:
I have a main form with two subforms. The second subform has a combo box whose recordsource is set based on a field in the first subform. I tried putting some code in the first subform to do...
4
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
9
by: frys | last post by:
Access 2003 Windows XP I have a form that is for tracking attendance at programs. the main form is the program information, and the sub form is the attendance information. I have 5 homes...
0
by: sparks | last post by:
I was using this to swap out a form with subforms on it by just making a copy and tying each to copy of the same table. subformV1 tblVisit1 subformV2 tblVisit2 etc Select Case TabCtl0.Value...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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,...
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.