How to change the linking fields on a subform

K

Ken Sheridan

Open the parent form in design view and select the subform control; that's
the control which houses the subform. In its properties sheet change the
LinkMasterFields and LinkChildFields properties. The former is usually the
name of a field in the parent form's underlying table or query, and the
latter the name of the corresponding field in the subform's underlying table
or query. The subform will return rows where the value of the field in
question matches that of the field in the parent form's current record.

Bear in mind that the LinkmasterFields property can also be the name of an
unbound control in the parent form, so you could have an unbound combo box
which lists all customers say, and the subform could show the selected
customer's orders.

Also the properties can include more than one field name, separated by a
semi-colon. Both properties must include the same number of field names,
however.

Ken Sheridan
Stafford, England
 
R

Roger Carlson

You have to bring up the subform *control* properties. To do that,
right-click on the very edge of your subform. It's a little tricky to find.
If you click in the subform, you'll get the properties for the form
contained in the subform control. But if you click the edge, you get the
properties of the subform control. You can tell when you have the right
one, because the property box heading will say Subform/Subreport: followed
by the form name. When you're in the form property box, it will just have
the form name.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
J

John W. Vinson

I have a subform but want to change how they are linked


How can i do this

Thanks

Open the main form in design view. Select the subform control - the box
containing the subform, not the form within that box - by clicking the edge of
it, or selecting it from the dropdown box listing all the controls on the form
(to the left of the toolbar).

Set the Master Link Field and Child Link Field properties as appropriate.

John W. Vinson [MVP]
 
Top