mattelhart
Technical User
- Sep 13, 2006
- 3
I have a subform which contains 2 combo boxes. The second combo box's source is dependant on the preceding combo box This is the row source code for combo2
SELECT Table2.Column2, Table2.Column1 FROM Table2 WHERE (((Table2.Column1)=Combo1));
This code works fine if I run it from the main form but not when I run it from a subform. The problem is that the whichever Combo1 I select first becomes the row source for all Combo2 boxes until I close and reopen the main form. I can slect Refresh from the Records menu after each update and it will fix the problem but how can I do this with VBA code? I've been messing with Requery but am not having much luck. Any ideas? Thanks.
SELECT Table2.Column2, Table2.Column1 FROM Table2 WHERE (((Table2.Column1)=Combo1));
This code works fine if I run it from the main form but not when I run it from a subform. The problem is that the whichever Combo1 I select first becomes the row source for all Combo2 boxes until I close and reopen the main form. I can slect Refresh from the Records menu after each update and it will fix the problem but how can I do this with VBA code? I've been messing with Requery but am not having much luck. Any ideas? Thanks.