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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

linking two subforms



 
 
Thread Tools Display Modes
  #1  
Old December 7th, 2008, 05:16 PM posted to microsoft.public.access
Gen
external usenet poster
 
Posts: 46
Default linking two subforms

Hi there,

I am using Acess 03 and I don't know if this is possible. I have three
tables linked sequentially through one-to-many relationships. I'd like to
create a mainform with two subforms, 1 and 2. The mainform would display data
from table1, subform1 would be the related records in table2 for the record
in the mainform as a datasheet, and subform2 displaying the related records
in table 3 for the selected record in subform1. I had no trouble creating the
main form and subform1, the trouble is subform2. Does this make sense? is it
possible? Thanks for your help
  #2  
Old December 7th, 2008, 05:34 PM posted to microsoft.public.access
Steve[_57_]
external usenet poster
 
Posts: 598
Default linking two subforms

1. Create subform2 as if it was a standalone single form.
2. Create subform1 as if it was a standalone single form. Drag and drop
subform2 onto subform1 to make subform2 a subform of subform1.
3. Create your main form. Drag and drop subform1 onto your mainform to
make subform1 a subform of your mainform.

Steve



"Gen" wrote in message
...
Hi there,

I am using Acess 03 and I don't know if this is possible. I have three
tables linked sequentially through one-to-many relationships. I'd like to
create a mainform with two subforms, 1 and 2. The mainform would display
data
from table1, subform1 would be the related records in table2 for the
record
in the mainform as a datasheet, and subform2 displaying the related
records
in table 3 for the selected record in subform1. I had no trouble creating
the
main form and subform1, the trouble is subform2. Does this make sense? is
it
possible? Thanks for your help



  #3  
Old December 7th, 2008, 05:42 PM posted to microsoft.public.access
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default linking two subforms

There is an example in the Northwind sample database that came with your
version of Access.

One way to accomplish what you want is to set a hidden textbox on the main
form equal to the primary key on Subform 1. Then set the foreign key link on
Subform 2 equal to that textbox.

It should look like:

LinkMaster: [Forms]![MainFormName]![HiddenTextboxName]
LinkChild: [ForeignKeyName]

As new records in Subform 2 are created, they will pick up the proper
foreign key value.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Gen" wrote in message
...
Hi there,

I am using Acess 03 and I don't know if this is possible. I have three
tables linked sequentially through one-to-many relationships. I'd like to
create a mainform with two subforms, 1 and 2. The mainform would display
data
from table1, subform1 would be the related records in table2 for the
record
in the mainform as a datasheet, and subform2 displaying the related
records
in table 3 for the selected record in subform1. I had no trouble creating
the
main form and subform1, the trouble is subform2. Does this make sense? is
it
possible? Thanks for your help



  #4  
Old December 16th, 2008, 02:08 PM posted to microsoft.public.access
Gen
external usenet poster
 
Posts: 46
Default linking two subforms

thanks that was really simple and worked perfectly.

"Arvin Meyer [MVP]" wrote:

There is an example in the Northwind sample database that came with your
version of Access.

One way to accomplish what you want is to set a hidden textbox on the main
form equal to the primary key on Subform 1. Then set the foreign key link on
Subform 2 equal to that textbox.

It should look like:

LinkMaster: [Forms]![MainFormName]![HiddenTextboxName]
LinkChild: [ForeignKeyName]

As new records in Subform 2 are created, they will pick up the proper
foreign key value.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Gen" wrote in message
...
Hi there,

I am using Acess 03 and I don't know if this is possible. I have three
tables linked sequentially through one-to-many relationships. I'd like to
create a mainform with two subforms, 1 and 2. The mainform would display
data
from table1, subform1 would be the related records in table2 for the
record
in the mainform as a datasheet, and subform2 displaying the related
records
in table 3 for the selected record in subform1. I had no trouble creating
the
main form and subform1, the trouble is subform2. Does this make sense? is
it
possible? Thanks for your help




 




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


All times are GMT +1. The time now is 09:09 PM.


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