I'm trying to get a listbox to display results of a query that are only related to the current record being viewed.
I have a form (setup as a continuous form) that displays a vendor table. I have a query setup to reference what parts a vendor supplies, and I would like those results to be visible on the form. I would use a subform to make this happen, but if I try and drop a subform on the main form, it says it won't do it with a continuous form. So, the listbox. I copied my form, dropped in the subform, and took a copy of the SQL statement. I then took that SQL statement and dropped it on the Row Source of the unbound listbox. I do get a return of Parts and Prices, but its the whole list, not just a list for the currently displayed vendor. My SQL is currently thus:
I have tried to wrap my head around it, and I'm stuck. GoogleFu has also failed me, as I can't find something quite on point to what I'm doing.Code:SELECT tblPrice.[Part Number], tblPrice.Cost, tblPrice.[Price Date], tblPrice.[Bulk Discount], tblVendors.[Vendor Name] FROM tblVendors INNER JOIN tblPrice ON tblVendors.[VendorID] = tblPrice.[VendorID];
Any suggestions?
Thanks!