M
Mike
I have a query to find total IndirectHours for each worker
and a query to find total DirectHours for each worker. I
created a form with text boxes to display the results for
each worker. I then added a text box to compute each
workers productivity.
This works great as long as a worker has an entry for both
DirectHours and IndirectHours. However, if one or both are
missing I get #Error in the Productivity text box. Is
there a way for the total Direct/IndirectHours to enter a
zero if that worker didn't have an entry? I tried to use
the Default Setting set to 0 but that didn't work.
My form is setup like this:
Text Boxes:
[WorkerID]
[Name]
[txtDirectHours] total hours from query - qryDirectHours
[txtIndirectHours] total hours from query - qryIndirHours
[txtTotalHours] = [txtDirectHours]+[txtIndirectHours]
[txtDirectPerc] from qryWork [DirectPercent] calculated
with this formula: [DirPay]/[DirHours]/[WageBase]
[txtA] = [txtDirectHours]/[txtTotalHours]*[txtDirectPerc]
[txtB] = [txtIndirectHours]/[txtTotalHours]*100
[Productivity] = [txtA]+[txtB]
and a query to find total DirectHours for each worker. I
created a form with text boxes to display the results for
each worker. I then added a text box to compute each
workers productivity.
This works great as long as a worker has an entry for both
DirectHours and IndirectHours. However, if one or both are
missing I get #Error in the Productivity text box. Is
there a way for the total Direct/IndirectHours to enter a
zero if that worker didn't have an entry? I tried to use
the Default Setting set to 0 but that didn't work.
My form is setup like this:
Text Boxes:
[WorkerID]
[Name]
[txtDirectHours] total hours from query - qryDirectHours
[txtIndirectHours] total hours from query - qryIndirHours
[txtTotalHours] = [txtDirectHours]+[txtIndirectHours]
[txtDirectPerc] from qryWork [DirectPercent] calculated
with this formula: [DirPay]/[DirHours]/[WageBase]
[txtA] = [txtDirectHours]/[txtTotalHours]*[txtDirectPerc]
[txtB] = [txtIndirectHours]/[txtTotalHours]*100
[Productivity] = [txtA]+[txtB]