Main form with 2 subforms

D

DNuding

I have been researching this on this group for a few days trying to find
something that relates to my challenge. Have found a few things to try, but
can not get the desired result.

I have a main form, not bound to anything.
On this form, I have 2 subforms.

Subform1 is generated from tblPeopleMaster and has all the fields from that
table. It is single form view on a tabbed form.
PersonID - PK
PersonFN
PersonMN
PersonLN
PersonAddress
and so on.

Subform2 is generated from a query of tblPeopleMaster and has 4 fields from
that query and is on a tabbed form. It is a datasheet view with these 4
columns. (Or, should this be generated from the table instead?)
PersonID
PersonFN
PersonMN
PersonLN

I want to select a record on Subform2 (where these records are listed in
datasheet form) and have that information appear in Subform1.

Sounds simple enough, I cannot figure it out. Thanks in advance for any
assistance.
 
G

Graham Mandeno

Hi DN

On your main form, add a textbox named txtLinkPersonID, and set its
ControlSource to:
=[Subform2].Form![PersonID]
(You can make it invisible later, but leave it visible for the moment, for
debugging purposes)

Now, for Subform1, set the following Link Master/Child Fields properties:
LinkMasterFields: txtLinkPersonID
LinkChildFields: PersonID

Now it should all work. Not a single line of code!
 
D

DNuding

Yes, it works perfectly! Thank a bunch, and I really like the "not a single
line of code" part!
--
DN


Graham Mandeno said:
Hi DN

On your main form, add a textbox named txtLinkPersonID, and set its
ControlSource to:
=[Subform2].Form![PersonID]
(You can make it invisible later, but leave it visible for the moment, for
debugging purposes)

Now, for Subform1, set the following Link Master/Child Fields properties:
LinkMasterFields: txtLinkPersonID
LinkChildFields: PersonID

Now it should all work. Not a single line of code!
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand


DNuding said:
I have been researching this on this group for a few days trying to find
something that relates to my challenge. Have found a few things to try,
but
can not get the desired result.

I have a main form, not bound to anything.
On this form, I have 2 subforms.

Subform1 is generated from tblPeopleMaster and has all the fields from
that
table. It is single form view on a tabbed form.
PersonID - PK
PersonFN
PersonMN
PersonLN
PersonAddress
and so on.

Subform2 is generated from a query of tblPeopleMaster and has 4 fields
from
that query and is on a tabbed form. It is a datasheet view with these 4
columns. (Or, should this be generated from the table instead?)
PersonID
PersonFN
PersonMN
PersonLN

I want to select a record on Subform2 (where these records are listed in
datasheet form) and have that information appear in Subform1.

Sounds simple enough, I cannot figure it out. Thanks in advance for any
assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top