A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

2 subforms within a main subform



 
 
Thread Tools Display Modes
  #1  
Old November 16th, 2005, 12:55 AM
gg
external usenet poster
 
Posts: n/a
Default 2 subforms within a main subform

I have 1 main form with 2 subforms.
1)Main form: has contract#(key), type (key)--this form displays info only.
2)Subform1: has contract#(key), type(key), line_item# (key)--this form
displays info only.
3)Subform2: has contract#(key), type(key), line_item# (key)--This subform2
is an input form.

How can I get the line_item# from Subform1 into Subform2 so when the user
cursor's thru each record in Subform1, the Subform2's record changes to match
with the line_item# in Subform1?

Help! Thank you.


  #2  
Old November 16th, 2005, 01:29 AM
John Vinson
external usenet poster
 
Posts: n/a
Default 2 subforms within a main subform

On Tue, 15 Nov 2005 16:55:04 -0800, "gg"
wrote:

I have 1 main form with 2 subforms.
1)Main form: has contract#(key), type (key)--this form displays info only.
2)Subform1: has contract#(key), type(key), line_item# (key)--this form
displays info only.
3)Subform2: has contract#(key), type(key), line_item# (key)--This subform2
is an input form.

How can I get the line_item# from Subform1 into Subform2 so when the user
cursor's thru each record in Subform1, the Subform2's record changes to match
with the line_item# in Subform1?


Set Subform2's Master Link Field to

[Contract#];Forms![Mainformname]![FirstSubformName].Form![Line_Item#]

and its Child Link Field to

[Contract#];[Line_Item#]

Note that you will almost surely get error messages like "the record
is currently locked by another user" if you're trying to display (with
the potential of editing, Access can't tell) the record in Subform1
and edit it also in Subform2. You may want to consider just using one
subform, and toggling its Allow Edits property on and off.

John W. Vinson[MVP]
  #3  
Old November 16th, 2005, 04:59 AM
gg
external usenet poster
 
Posts: n/a
Default 2 subforms within a main subform



"John Vinson" wrote:

On Tue, 15 Nov 2005 16:55:04 -0800, "gg"
wrote:

I have 1 main form with 2 subforms.
1)Main form: has contract#(key), type (key)--this form displays info only.
2)Subform1: has contract#(key), type(key), line_item# (key)--this form
displays info only.
3)Subform2: has contract#(key), type(key), line_item# (key)--This subform2
is an input form.

How can I get the line_item# from Subform1 into Subform2 so when the user
cursor's thru each record in Subform1, the Subform2's record changes to match
with the line_item# in Subform1?


Set Subform2's Master Link Field to

[Contract#];Forms![Mainformname]![FirstSubformName].Form![Line_Item#]

and its Child Link Field to

[Contract#];[Line_Item#]

Note that you will almost surely get error messages like "the record
is currently locked by another user" if you're trying to display (with
the potential of editing, Access can't tell) the record in Subform1
and edit it also in Subform2. You may want to consider just using one
subform, and toggling its Allow Edits property on and off.

John W. Vinson[MVP]

Hi John,

Thanks for your suggestions. Can you please explain what the Allow Edits
property will do? So even if the record in Subform1 is only for viewing, and
the Subform2 is for editing and saving, and they are related to 2 different
tables, is there a way to get this to work? My subform2 is going against a
Billing table. And Subform1 is going against the Contracts table.

Is there an alternate way to do this? I'm open to any suggestions and am
still learning.

Thank you!!

gg
  #4  
Old November 16th, 2005, 06:29 AM
gg
external usenet poster
 
Posts: n/a
Default 2 subforms within a main subform

Somehow the Subform2 properties keep changing from the Linked Master and
Child under the Control Source to the Record Source (the Linked Master and
Child options disappear). What am I doing wrong?

"gg" wrote:



"John Vinson" wrote:

On Tue, 15 Nov 2005 16:55:04 -0800, "gg"
wrote:

I have 1 main form with 2 subforms.
1)Main form: has contract#(key), type (key)--this form displays info only.
2)Subform1: has contract#(key), type(key), line_item# (key)--this form
displays info only.
3)Subform2: has contract#(key), type(key), line_item# (key)--This subform2
is an input form.

How can I get the line_item# from Subform1 into Subform2 so when the user
cursor's thru each record in Subform1, the Subform2's record changes to match
with the line_item# in Subform1?


Set Subform2's Master Link Field to

[Contract#];Forms![Mainformname]![FirstSubformName].Form![Line_Item#]

and its Child Link Field to

[Contract#];[Line_Item#]

Note that you will almost surely get error messages like "the record
is currently locked by another user" if you're trying to display (with
the potential of editing, Access can't tell) the record in Subform1
and edit it also in Subform2. You may want to consider just using one
subform, and toggling its Allow Edits property on and off.

John W. Vinson[MVP]

Hi John,

Thanks for your suggestions. Can you please explain what the Allow Edits
property will do? So even if the record in Subform1 is only for viewing, and
the Subform2 is for editing and saving, and they are related to 2 different
tables, is there a way to get this to work? My subform2 is going against a
Billing table. And Subform1 is going against the Contracts table.

Is there an alternate way to do this? I'm open to any suggestions and am
still learning.

Thank you!!

gg

  #5  
Old November 16th, 2005, 05:35 PM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default 2 subforms within a main subform

On Tue, 15 Nov 2005 22:29:01 -0800, "gg"
wrote:

Somehow the Subform2 properties keep changing from the Linked Master and
Child under the Control Source to the Record Source (the Linked Master and
Child options disappear). What am I doing wrong?


Are you looking at the properties of the Subform Control (the box on
the mainform which contains the subform)? or the properties of the
Form which is within that control? These are two separate objects,
each with their own properties.

To see the properties of the Subform Control, select it from the
dropdown list of controls at the left of the toolbar, or carefully
click on the *edge* of the subform box so it highlights.

To see the properties of the Form, click the little square at the
upper left intersection of the rulers within the subform.

John W. Vinson[MVP]
 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reporting subreport total on main report BobV Setting Up & Running Reports 22 November 1st, 2005 03:19 AM
Confussed as to which control to reference subform melwester Using Forms 5 June 30th, 2005 06:49 PM
Subform Refresh Problem (but only with an unbound combo box control) Barry Skidmore Using Forms 1 December 21st, 2004 01:19 AM
dealing with a subform record when it's "dirty" Paul James Using Forms 8 October 17th, 2004 08:45 AM
Recordset in subform based on field in parent form Lyn General Discussion 15 June 14th, 2004 03:10 PM


All times are GMT +1. The time now is 10:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.