If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
using the combo box value to generate subform query
I made a subform on my my form from a query i have. I am asking it to
populate a list. The query works fine but I am having to type in the parameter value form what company I am looking for. As for the actual form I have a combo box. I want this list to populate when they select a compnay from the combo box. What to I have to type in the SQL statement to achieve this??? Here is my SQL statement I used to create my query, like i said- its works fine with me having to type in the company name manually. The combo box on the form is currently called Combo14: SELECT DISTINCT Projects.Project_Date, Projects.Project_Name, Company_Name.Company_ID, Projects.Project_Cost, Company_Name.CompanyName, Invoice.Invoice_Date FROM Projects INNER JOIN (Invoice INNER JOIN ((Company_Name INNER JOIN [Board Members] ON Company_Name.Company_ID = [Board Members].Company_ID) INNER JOIN Project_Activities ON Company_Name.Company_ID = Project_Activities.Company_ID) ON Invoice.Invoice_ID = Project_Activities.Invoice_ID) ON Projects.Project_ID = Project_Activities.Project_ID WHERE (((Projects.Project_Date)="07") AND ((Company_Name.CompanyName)=[Combo14])) ORDER BY Projects.Project_Date DESC , Projects.Project_Name; i hope i explained it ok. let me know if you guys have any questions. -- Gabriel -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
#2
|
|||
|
|||
using the combo box value to generate subform query
If your SQL is in a stored query, include the form name in the Where Clause:
WHERE (((Projects.Project_Date)="07") AND ((Company_Name.CompanyName)=[Forms]![YourFormName]![Combo14])) "gabriels via AccessMonster.com" wrote: I made a subform on my my form from a query i have. I am asking it to populate a list. The query works fine but I am having to type in the parameter value form what company I am looking for. As for the actual form I have a combo box. I want this list to populate when they select a compnay from the combo box. What to I have to type in the SQL statement to achieve this??? Here is my SQL statement I used to create my query, like i said- its works fine with me having to type in the company name manually. The combo box on the form is currently called Combo14: SELECT DISTINCT Projects.Project_Date, Projects.Project_Name, Company_Name.Company_ID, Projects.Project_Cost, Company_Name.CompanyName, Invoice.Invoice_Date FROM Projects INNER JOIN (Invoice INNER JOIN ((Company_Name INNER JOIN [Board Members] ON Company_Name.Company_ID = [Board Members].Company_ID) INNER JOIN Project_Activities ON Company_Name.Company_ID = Project_Activities.Company_ID) ON Invoice.Invoice_ID = Project_Activities.Invoice_ID) ON Projects.Project_ID = Project_Activities.Project_ID WHERE (((Projects.Project_Date)="07") AND ((Company_Name.CompanyName)=[Combo14])) ORDER BY Projects.Project_Date DESC , Projects.Project_Name; i hope i explained it ok. let me know if you guys have any questions. -- Gabriel -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
Thread Tools | |
Display Modes | |
|
|