Problem with combo box on datasheet subform

madhouse

Registered User.
Local time
Today, 23:07
Joined
Jul 3, 2002
Messages
65
Ok, basically the problem is that I have a subform where the default view is set to Datasheet. On this subform I have 5 fields, 2 of which are combo boxes. The values in the first combo box (cboCategory) are populated from table Category. The values in the second combo box (cboType) are populated from table Products and are dependant on what value is selected in the first combo box. Up to this point everything works fine - I'm able to populate the second combo box with the correct values depending on what was selected in the first combo box. However, when I then select a value in the second combo box, all of the values for cboType in the existing records displayed on the datasheet subform also change!!! What am I doing wrong??

Just for your information, the RowSource for the first combo box is as follows:

SELECT Category.CategoryID, Category.CategoryName FROM Category;

The values for the second combo box are populated via the following query:

SELECT DISTINCT Products.ProductID, Products.ProductName, Products.CategoryID FROM Products WHERE Products.CategoryID=[Forms]![Product_frm]![Products_detail_frm].[Form]![cboCategory];

Any ideas as to what I'm doing wrong??
 
Ok so what I'm thinking is, I need to do a query based on the combobox, and have the sub forum pull information from that query, right?

Well I created a new query but I don't know how to base that query on the combobox... I'm assuming that is the first step.

I'm trying to be proactive here as I really want to learn how to use access.
 
Ok, thanks to an awesome tutorial I found on these forums I have made some progress.

I made a query and linked it to my combo box and then linked the subforum to the query... now the stuff works. Awesome.
 
Ok, thanks to an awesome tutorial I found on these forums I have made some progress.

I made a query and linked it to my combo box and then linked the subforum to the query... now the stuff works. Awesome.

Do you have the link to that tutorial? I'm having a similar problem and could use the help myself. Thanks.
 
Do you have the link to that tutorial? I'm having a similar problem and could use the help myself. Thanks.

Yeah I found it on this board and I cant seem to relocate the original thread. I'll upload it in my post but I take no credit for it. The guy who posted it originally goes by the handle "smercer"

I found it to be the most helpful thing on access that I've read yet - I'd love to get my hands on more tutorials like this.
 

Attachments

Yeah I found it on this board and I cant seem to relocate the original thread. I'll upload it in my post but I take no credit for it. The guy who posted it originally goes by the handle "smercer"

I found it to be the most helpful thing on access that I've read yet - I'd love to get my hands on more tutorials like this.

Not sure if I can apply it to my particular situation (using combo boxes to filter a dual subform), but a very helpful tutorial nonetheless. Thanks for the link.
 

Users who are viewing this thread

Back
Top Bottom