how to open a subform to match parent record

martinr

Registered User.
Local time
Today, 15:01
Joined
Nov 16, 2011
Messages
74
i have a subform linked to it's parent form (linked via Master/Child fields) so when a surname is selected using a Combobox on the parent form only the matching records are listed in subform.



this works Ok except the whenever time the main form is opened the subform doesn't match the record in the combobox in parent form (ie parent form surname = ALLAN, subform surname = JONES).



the parent form's recordsource is a simple query and the combobox rowsource is also a query and is set to the load the first value (itemdata = 0)


how can i get the subform records to match the parent form when they load?
 
Hmm, something is off. You say the Main Form and the Subform are linked. What field are they linked on?
 
hi Gina,
they are linked on the surname field;

link master field = surname
link child field = surname


the linking works fine once the parent form record is updated - it's only when the form
is first opened that they don't match.
thank-you...
 
Umm, so the link doesn't work because two entities can have the same Surname. That might very well be why you are having a problem. Isn't there a Primary Key you can link on?
 
the Link Master Fields should be the name of the combobox.
 

Users who are viewing this thread

Back
Top Bottom