T
tbrogdon
I have a SELECT query:
PARAMETERS forms![frmSetEmpHours]![txtDate] DateTime;
SELECT Employees.EmployeeID, [ProductionDate] AS Expr1,
Employees.Department, Employees.Shift, Shift.ShiftHours
FROM Shift INNER JOIN (Department INNER JOIN Employees ON
Department.Department=Employees.Department) ON
Shift.Shift=Employees.Shift
WHERE ((([ProductionDate])=forms!frmSetEmpHours!txtDate) And
((Employees.Department)=forms!frmSetEmpHours!cboDept) And
((Employees.Shift)=forms!frmSetEmpHours!cboShift));
I have frmSetEmpHours w/
txtProductionDate: unbound text field - where user enters date
cboDepartment: bound
cboShift: bound
I want to pull all a recordset of all Employees from a specific
department/shift combination and add a date field on the fly to all
the entries.
I thought that I could use the unbound txtDate from the form to
capture the date input and funnel that into Expr1 to accomplish this.
Well it works...sort of.
When I fill out the txtDate, cboDept, and cboShift and click the
cmdRunQuery button Access pops up a parameter dialog box
"EnterParameter Value" caption: ProductionDate instead of taking the
value from frmSetEmpHours.txtDate. If I fill in this parameter box and
click OK it returns the dataset that I expected.
How can I get the query to get the date value from the form rather
than popping up an extra dialog box?
Thanks,
Tim
PARAMETERS forms![frmSetEmpHours]![txtDate] DateTime;
SELECT Employees.EmployeeID, [ProductionDate] AS Expr1,
Employees.Department, Employees.Shift, Shift.ShiftHours
FROM Shift INNER JOIN (Department INNER JOIN Employees ON
Department.Department=Employees.Department) ON
Shift.Shift=Employees.Shift
WHERE ((([ProductionDate])=forms!frmSetEmpHours!txtDate) And
((Employees.Department)=forms!frmSetEmpHours!cboDept) And
((Employees.Shift)=forms!frmSetEmpHours!cboShift));
I have frmSetEmpHours w/
txtProductionDate: unbound text field - where user enters date
cboDepartment: bound
cboShift: bound
I want to pull all a recordset of all Employees from a specific
department/shift combination and add a date field on the fly to all
the entries.
I thought that I could use the unbound txtDate from the form to
capture the date input and funnel that into Expr1 to accomplish this.
Well it works...sort of.
When I fill out the txtDate, cboDept, and cboShift and click the
cmdRunQuery button Access pops up a parameter dialog box
"EnterParameter Value" caption: ProductionDate instead of taking the
value from frmSetEmpHours.txtDate. If I fill in this parameter box and
click OK it returns the dataset that I expected.
How can I get the query to get the date value from the form rather
than popping up an extra dialog box?
Thanks,
Tim