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

Subforms problem



 
 
Thread Tools Display Modes
  #1  
Old December 14th, 2006, 05:34 PM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default Subforms problem

I have a main form with two separate subforms.

One subform holds branch address info and the other subform holds logged
queries associated with each branch address.

When I change from one branch ID to another, the info in the queries subform
doesn't match up.

An earlier incarnation of my DB did have one subform inside the other but it
looked too confusing.

help!


  #2  
Old December 14th, 2006, 05:44 PM posted to microsoft.public.access.forms
Sprinks
external usenet poster
 
Posts: 531
Default Subforms problem

Scubadiver,

Two subforms on a main form cannot be linked directly. One choice is to
insert one as a subform on the other. The drawback to this is that you can't
insert a continuous subform on another subform.

The solution is to place an unbound textbox, usually hidden, on the main
form, set its ControlSource to the primary key of the first subform, and link
your second subform to it. Assuming the list of queries table or query has a
BranchID field that you can link by, set the following:

ControlSource Expression: =[FirstSubform].Form![BranchIDControl]

Place the second subform on the main form, and set its LinkMasterFields to
the name of the textbox, and the LinkChildFields to BranchID.

Hope that helps.
Sprinks


"scubadiver" wrote:

I have a main form with two separate subforms.

One subform holds branch address info and the other subform holds logged
queries associated with each branch address.

When I change from one branch ID to another, the info in the queries subform
doesn't match up.

An earlier incarnation of my DB did have one subform inside the other but it
looked too confusing.

help!


  #3  
Old December 15th, 2006, 10:10 AM posted to microsoft.public.access.forms
scubadiver
external usenet poster
 
Posts: 1,673
Default Subforms problem

thanks. It seems to have worked.

I tried doing this before but changed the design to put one form inside the
other. I then decided that it looked too messy!

"Sprinks" wrote:

Scubadiver,

Two subforms on a main form cannot be linked directly. One choice is to
insert one as a subform on the other. The drawback to this is that you can't
insert a continuous subform on another subform.

The solution is to place an unbound textbox, usually hidden, on the main
form, set its ControlSource to the primary key of the first subform, and link
your second subform to it. Assuming the list of queries table or query has a
BranchID field that you can link by, set the following:

ControlSource Expression: =[FirstSubform].Form![BranchIDControl]

Place the second subform on the main form, and set its LinkMasterFields to
the name of the textbox, and the LinkChildFields to BranchID.

Hope that helps.
Sprinks


"scubadiver" wrote:

I have a main form with two separate subforms.

One subform holds branch address info and the other subform holds logged
queries associated with each branch address.

When I change from one branch ID to another, the info in the queries subform
doesn't match up.

An earlier incarnation of my DB did have one subform inside the other but it
looked too confusing.

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 03:28 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.