D
Duane
Hello,
I am receiving and error when I try to execute the following code;
Set db = CurrentDb()
Set rst = db.OpenRecordset("SELECT Min(Employee.A1H) AS MinOfA1H FROM
Employee WHERE Employee.Group=[Forms]![frmEmployee]![Group] AND
Employee.A1H>0", dbOpenDynaset)
iHours = rst!MinOfA1H
MsgBox iHours
Run Time Error 3061
Too few parameters. Expected 1.
If I replace the =[Forms]![frmEmployee]![Group] with a hard coded =7 then it
works fine. I need for it to be dynamic in the sense that I need the
MinOfA1H of the group the employee is assigned to and that could be from
group 1 to group 7. The group field is an integer field in the table.
If I put a checkmark in the A1 field to assign an employee to the 1st shift
A list for overtime, I want run this query to get the minimum number of
hours worked for all employees in that group.
Thank you in advance.
I am receiving and error when I try to execute the following code;
Set db = CurrentDb()
Set rst = db.OpenRecordset("SELECT Min(Employee.A1H) AS MinOfA1H FROM
Employee WHERE Employee.Group=[Forms]![frmEmployee]![Group] AND
Employee.A1H>0", dbOpenDynaset)
iHours = rst!MinOfA1H
MsgBox iHours
Run Time Error 3061
Too few parameters. Expected 1.
If I replace the =[Forms]![frmEmployee]![Group] with a hard coded =7 then it
works fine. I need for it to be dynamic in the sense that I need the
MinOfA1H of the group the employee is assigned to and that could be from
group 1 to group 7. The group field is an integer field in the table.
If I put a checkmark in the A1 field to assign an employee to the 1st shift
A list for overtime, I want run this query to get the minimum number of
hours worked for all employees in that group.
Thank you in advance.