View Full Version : SubForm Link


c_shutty
05-17-2001, 12:20 AM
I have a form in access 97 with a subform built into it. on the main form there is a combo box with a list of company products and when I select a product I want the subform to only show data that relates to that particular product. The state of the form at the moment is that I can select a product from the list and the subform shows all details for all the products (With out the filter), but when I go to the design of the form and back to the normal form view it works! I find this very strange and can’t find an explanation. On the properties of the subform I have linked the parent and master fields but when I did this I found it strange that on the subform field liner the result showed up as - Show <SQL Statement> for each record in tblProduct using ProductCode. (Shouldn’t it have a table or query name instead of <SQL Statement> )

KevinM
05-17-2001, 12:50 AM
Add the linked fields manually.

In main form design view highlight the subform and in in the Master Link field put [ComboName]. In the Child link filed put [LinkFieldName]

HTH

c_shutty
05-17-2001, 02:20 AM
Thanks Kevin,

I tried that but it still didn't work the only difference is that by going into the design view and back to the normal view the problem still exists where as before this would resolve the problem.

Matthew Snook
05-17-2001, 06:45 AM
I have been trying to sort a subform, so your post caught my eye. It sounds like the query used to fill the subform is working correctly, but only once. Then it never updates itself. You might try a "requery" on the subform, and put it in the "afterupdate" event of the combo box. There are examples in the Access help. Maybe it will work!

Good Luck,

Matt