Hi,
I have got two tables with the following fields:
"tblcompanies"
companyid (primary key)
companyname
"tblprojects"
projectID (primary key)
Projectname
company1
company2
company3
company4
company5
and many other fields
(please note that all company fields in this table are lookup fields and that these tables have a one to many relationship)
I am trying to make a form where a user first picks the company from a combo box (called pickcompany) which then limits the values for another combo box (called combo84)which shows all relevant projects. After selecting a project in combo84 the form shows all the rest of the fields from "tblprojects"
Row source for pickcompany is:
SELECT [Companies].[Company ID], [Companies].[Company Name] FROM Companies;
Row source for combo84 is:
SELECT [Companies].[Company ID], [Companies].[Company Name], [Projects].[Project ID], [Projects].[Project Name] FROM Companies INNER JOIN Projects ON [Companies].[Company ID]=[Projects].[Company ID] WHERE ((([Companies].[Company Name])=[Forms]![Projects]![PickCompany])) ORDER BY [Companies].[Company Name], [Projects].[Project Name];
This all works fine if one company has many projects but I am stuck when multiple companies have one project!
Which combo box' query should I change? And to what????
Thnx in advance
RvM
I have got two tables with the following fields:
"tblcompanies"
companyid (primary key)
companyname
"tblprojects"
projectID (primary key)
Projectname
company1
company2
company3
company4
company5
and many other fields
(please note that all company fields in this table are lookup fields and that these tables have a one to many relationship)
I am trying to make a form where a user first picks the company from a combo box (called pickcompany) which then limits the values for another combo box (called combo84)which shows all relevant projects. After selecting a project in combo84 the form shows all the rest of the fields from "tblprojects"
Row source for pickcompany is:
SELECT [Companies].[Company ID], [Companies].[Company Name] FROM Companies;
Row source for combo84 is:
SELECT [Companies].[Company ID], [Companies].[Company Name], [Projects].[Project ID], [Projects].[Project Name] FROM Companies INNER JOIN Projects ON [Companies].[Company ID]=[Projects].[Company ID] WHERE ((([Companies].[Company Name])=[Forms]![Projects]![PickCompany])) ORDER BY [Companies].[Company Name], [Projects].[Project Name];
This all works fine if one company has many projects but I am stuck when multiple companies have one project!
Which combo box' query should I change? And to what????
Thnx in advance
RvM