Ola Frank:
If you have the Master/Child relationship set in the subform's
Properties/Data/ tab, the subform recordset will automatically be
filtered to display only those records related to the master record ID
currently in context.
The Master record Key must be a field in the Child form's Record
source and the Master/Child relationship set between these two fields:
Forms("MasterForm").RecordSource = "SELECT *.* FROM MasterTable"
Forms("ChildForm").Recordsource = "SELECT *.* FROM ChildTable"
Form("MasterForm").sfmChildSubform.LinkChildFields := chMasterID
Form("MasterForm").sfmChildSubform.LinkMasterField s:= maID
where 'maID' is the master record key and 'chMasterID' is the child
record's pointer the the related master.
By doing this you can remove any criteria from the subform's
RecordSource query and let access keep the records in synch.
Rich Harrington
Chi
frankbradley (AT) insightbb (DOT) com (Fbradley) wrote in message news:<8e6887e6.0407190834.64644c2 (AT) posting (DOT) google.com>...
Quote:
I have a subform based on a query. I use a dropdown list to pull up
records on the main form. I would like to have the subform/query
requery each time a new record is pulled up.
Can anyone give some advice?
Thanks |