[AccessD] Conditional subforms

Jim Lawrence accessd at shaw.ca
Thu Jun 18 23:10:39 CDT 2009


Thank you very much Stuart. Now that was simple so now I can resolve the
cascading SubForm problem. 

Unfortunately, I can proceed no further for the moment as the client has not
given me 'Carte blanche' to make any major changes... any changes for that
matter as he is afraid the whole project will go off the rails like with the
last programmer. ;-)

Wouldn't you guess; there is no foreign key and data is incomplete...

Jim
  

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Thursday, June 18, 2009 6:04 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Conditional subforms

My standard way of doing this doesn't need any code, just:

1. Create a hidden textbox on the parent form "txtsubForm1Link" and set its
source to  "= 
frmsubForm1.Form!fldPK"

2. Set the "Link Master Field" of subForm2 to "txtsubForm1Link" and the
"Link Child Field" 
to the foreign key in Form2.

It's all automagic from then.

I often do this to several levels of cascaded continuous forms on an unbound
parent form 
where there is a need to maintain the data in a hierarchy of related tables.

-- 
Stuart


On 18 Jun 2009 at 17:27, Jim Lawrence wrote:

> Hi All:
> 
> It has been a while since I have had to play with an Access DB but a
client
> has called and I am doing nothing... but doing a Reno on the house.
> 
> I know how to do linked combo box; that a no brainer but how do I extend
> that logic to two inter-connected Subforms on a form.
> 
> When an item is selected on the subform 1 it would be nice to display all
> related items on subform 2. Also each subform should allow new items to be
> added and deleted...
> 
> With enough code this could be done but there must be some 'nice' way
other
> than brute force.
> 
> TIA
> Jim   
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list