G
Guest
Hello all, I would really appreciate if someone can help me with it. I know
it's simple. But I just can't get it. I tried for hours before I gave up. All
I want is to display values in a subform based upon the value user chooses in
a combo box. I have three fields to be displayed "Parts", "Vendors", "Cost"
from a table called "Directory" and my combo box value is also from this
table but it has only the distinct values for "Parts". So what I want is
whenever the user chooses a "Part" in the combo box, the subform should
display all records with the chosen part value and it's corresponding Vendor
and Cost values. I have my combo box now with the distinct Parts based upon a
query and that query is the source for my form. I have another table which
has all the three fields as the source for my subform. But it's not working.
It pulls the data when the form gets loaded correctly for the first Part
type. But when I change my combo box value, the subform doesn't reflect it.
And I tried using after update for my combo box and I have given it's coding
below:
Private Sub cmbPartType_AfterUpdate()
DoCmd.OpenQuery "query1"
End Sub
Please let me know where I am going wrong.
Thanks!
it's simple. But I just can't get it. I tried for hours before I gave up. All
I want is to display values in a subform based upon the value user chooses in
a combo box. I have three fields to be displayed "Parts", "Vendors", "Cost"
from a table called "Directory" and my combo box value is also from this
table but it has only the distinct values for "Parts". So what I want is
whenever the user chooses a "Part" in the combo box, the subform should
display all records with the chosen part value and it's corresponding Vendor
and Cost values. I have my combo box now with the distinct Parts based upon a
query and that query is the source for my form. I have another table which
has all the three fields as the source for my subform. But it's not working.
It pulls the data when the form gets loaded correctly for the first Part
type. But when I change my combo box value, the subform doesn't reflect it.
And I tried using after update for my combo box and I have given it's coding
below:
Private Sub cmbPartType_AfterUpdate()
DoCmd.OpenQuery "query1"
End Sub
Please let me know where I am going wrong.
Thanks!