Bless u sir for you have been so very helpful. I have one last question how
do I fit this: Where ((([Category Code Table].[Category Code]
=Forms![frmMyParameterForm]![txtCategory1],[txtCategory2],[txtCategory3],[txtCategory4],[txtCategory5],[txtCategory6],[txtCategory7],[txtCategory8])));
into this code
SELECT [Category Code Table].[Category Code], Employees.EmployeeID,
Employees.LastName, Employees.FirstName, Employees.Team, Count([New Monitor
Query Sum of Fields - step 2W].SLastName) AS CountOfSLastName, Count([New
Monitor Query Sum of Fields - step 2W].RecordNumber) AS CountOfRecordNumber,
Avg([New Monitor Query Sum of Fields - step 2W].Expr67) AS Expr1 INTO
[Monitoring by Agent Group Table]
FROM [Category Code Table] INNER JOIN ([New Monitor Query Sum of Fields -
step 2W] INNER JOIN Employees ON [New Monitor Query Sum of Fields - step
2W].EmployeeID = Employees.EmployeeID) ON [Category Code Table].[Category
Code] = [New Monitor Query Sum of Fields - step 2W].[Category Code]
WHERE ((([New Monitor Query Sum of Fields - step
2W].MonitorDate)>=[Forms]![Weighted Heavy DRF]![Start Date?] And ([New
Monitor Query Sum of Fields - step 2W].MonitorDate)<=[Forms]![Weighted Heavy
DRF]![End Date?] ))
GROUP BY [Category Code Table].[Category Code], Employees.EmployeeID,
Employees.LastName, Employees.FirstName, Employees.Team
HAVING ((([Category Code Table].[Category Code]) In ([Category 1:],[Category
2:],[Category 3:],[Category 4:],[Category 5:],[Category 6:],[Category 7:])))
ORDER BY Employees.LastName;
I keep getting either comma or ) syntax error
Clifford Bass said:
Hi Julius,
I think I would use an unbound form with unbound controls. If you name
your form "frmMyParameterForm" and on it you have a control named
"txtCategory1"
you can reference that control in your query, as long as the form is open.
In your query you could have a condition (from the SQL view) "Where [Category
Code Table].[Category Code] = Forms![frmMyParameterForm]![txtCategory1]".
Hopefully that clarifies a bit.
Clifford Bass
Julius said:
Good day Clifford, you are the man, that info you told me to put into the SQL
works like a charm, that is exactly what I want to do. As far as the form I
have read your instructions over and over and I am still a little stump.
Question do I create a bound or unbound form, I was assuming bound because of
the Category Code parameters. I am not sure what
frmMyParameterForm![txtCategory1] means, I am going to continue to try
building the form. Thank you so much and any further assistance in that area
would be greatly appreciated.
Clifford Bass said:
Hi Julius,
Yes, subsititue your table's name for tblSomeTable. Since it contains
spaces in its name enclose it in square brackets. That gives:
SELECT [Category Code Table].[Category Code]
FROM [Category Code Table]
WHERE ((([Category Code Table].[Category Code]) In ([Category 1:],[Category
2:],[Category 3:],[Category 4:],[Category 5:],[Category 6:],[Category 7:])));
Perhaps the best way to understand is to start a new query in design
mode and cancel the select table dialog. It will put you into SQL mode.
Copy and paste the above text into the SQL window and then go to design mode.
Add any additional fields that you want to display and then go to datasheet
mode. Hopefully it will work without errors.
Clifford Bass