473,625 Members | 3,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3515
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...Subfor m2_FieldName
Link Parent
Fields...Forms! frmMainFormName !subForm1Subfor mControlName.Fo rm!Subform1_Fie l
dName

Note the syntax: Forms!<Main>!<S ubFormControl>! 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******** *************@n ews.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.sbfWorkerAbs ences.Requery

In the first subform's OnCurrent, mine is:

Me.Parent!sbfWo rkerAbsences.Re query

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******** *************@n ews.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*****@localh ost.not> wrote in message
news:nY******** **********@nwrd dc03.gnilink.ne t...
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.sbfWorkerAbs ences.Requery

In the first subform's OnCurrent, mine is:

Me.Parent!sbfWo rkerAbsences.Re query

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******** *************@n ews.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******** *************@n ews.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
2981
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 aspects of the project. On the masterform I have two unbound listboxes that I populate with information regarding the current record in one of the subforms.
2
2994
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 ("Bug Fix for SubForms with ScrollBars. Bug fix for SubForms without visible ScrollBars.") - BUT I still can't get it to work on my app with my subforms. I'm using Access 2000, It works fine on the main forms but not on the
0
2237
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 be choosers here so I have no idea when this would be done*. I'm just wondering if anyone has gotten around the problem some other way? --Original Thread---
7
2321
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 between the two subforms. But I put my mind to this again recently and came up with a solution (code below) that works well with multiple subforms to size both the heights and widths of the sunforms relative to each other, and it uses no additional...
4
3740
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 question is, how can I prevent Access from auto-saving changed or entered data on both the main form and any subform? The main goal is to force the user to use the 'Save' button to save any data. I need the 'Cancel' button to just undo any changes...
2
4555
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 through the AllForms collection, but it only shows the parent form as being loaded. I have a project with a large number of single forms that I would like to group together under one or a few parent forms, using Tab Controls to accomplish this;...
1
1737
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 this. This is the code in the Form Current section: strSQL = "SELECT * FROM ModuleComponents WHERE TrainingModuleTopicSK = " & subTrainingModule.Form!TrainingModuleTopicSK & ";"
4
6046
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 this is all very difficult to explain in words, please bear with me as I endevour to explain what it is I am trying to do. It would be helpful if I could attach a graphics file to this posting that would help explain what it is I'm trying to achieve...
9
16798
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 and need to switch between each home at any given time. Currently i use a tab form with 5 subforms attached filtering the attendance data for each home. What i wish to do is select a home from a combo/list box and have 1 subform show me the data...
0
1377
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 Case 0: 'Initial Visit Child6.SourceObject = "subformV1"
0
8189
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.