Subform-Form Interaction Problem... Stuck for hours.

pheidlauf

Registered User.
Local time
, 21:05
Joined
Jun 5, 2013
Messages
42
Hello. I am working on a form with two subforms. Based off of a combo box selection in the form, the first subform pulls up a list of names. What I want, is for the selected name in the first subform to control what the second subform pulls up (a list of training competencies that each person must have). I tried hiding a text box in the form and setting its value to be that of the primary key used by the subform to filter the 2nd subforms output, but setting the control source of the text box to the primary key of the subform causes the form to refresh constantly and refocus on the first record of the subform.

How can I have one subform effect the other? Let me know what information you need to help.

Thanks!
 
On main form, create a textbox.
Set the control source of the textbox to subform1Name.Form.NameOfTheKey

where subform1 is the one that will drive subform2

In the subform control containing subform 2 (the subform control is the one that is active when you click ONCE on your subform in design view of the main form), in the Data tab of the Propert sheet, set the Link MAster Fields to the textbox on the main form. And set the Link Child Fields to the FK in the subform.
 
When I tried that before, it caused the subform to shift focus to the first record once a second or so. Do you know how I can avoid that?
 
I don't think you have tried exactly what I suggested, because that is a standard verified method of syncronising two subforms.
 
Alright, I will give it another go. Thanks for the help so far.

EDIT:

So, it works, though the database shows that it is calculating the entire time I'm viewing it. The focus is not changing as it was before, but it recalculates the value of the text box once or twice a second. Is this normal? Or is there a way around this?
Thanks again.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom