A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

using the combo box value to generate subform query



 
 
Thread Tools Display Modes
  #1  
Old December 15th, 2006, 04:31 PM posted to microsoft.public.access.forms
gabriels via AccessMonster.com
external usenet poster
 
Posts: 1
Default 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  
Old December 15th, 2006, 05:44 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.