Master/Child Fields - Subforms

F

Flannel

I recently upgrade from Access 2000 to 2003 and a piece in
one of my programs no longer works.

I have a main form and 2 seperate subforms within it (not
a subform within another subform). When I select an item
from a list box on the main form, it then filters info for
a list box on subform1. I can then select an item from the
list box on subfrom1 and it shows me the record infomation
on subform2. For subform1 the Child and Master field
properties look like:

Link Child Fields: Account_ID
Link Master Fields: Account_ID

For subform2 they look like:

Link Child Fields: Contact_ID
Link Master Fields: Forms!MainForm!SubForm1!Contact_ID

This worked fine in 2000, but in 2003 it doesn't seem to
like the "Forms!MainForm!SubForm1!Contact_ID" syntax. It's
like it can't be linked to data on a seperate subform, it
has to be linked to data on the mainform. I did get it to
work if I have the main form, then the subform, and then a
subform of the subform, but I have a reason for not
wanting to do it this way. Any help or information on this
would be appreciated.
 
J

Joan Wild

I'll suggest an alternate approach.

Put a textbox on the main form and give it a name of txtLink. Set it's
control source to
=SubForm1.Form!ContactID

Change the link master/child for subform2 to

Link Child Fields: Contact_ID
Link Master Fields: txtLink

You can then get rid of the code behind subform1 that requeries subform2

Once you've got it working, you can hide the txtLink control.
 

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