B
Billiam
Ok, it has been 5 sleepless days...please help me.
I have a timesheet table (t_TimeSheet) which a form is based on (f_TimeSheet).
First I have a cboEmployee based on q_Employee which is a concatenated
Employee number and name.
Next, I have a cboPayPeriodFrom based on a lookup/reference table
(lt_PayPeriod) and a cboPayPeriodTo based on the same lookup/reference table.
(Long date Format).
Next I have cboWorkDate (Longdate Format).
Next is cboStartTime based on the lookup/refernce table lt_Time (Medium
Date) , then cboFinishTime same lookup table (Medium Date) , then cboLunch
based on lt_TimeInterval (Short Time format), and finally cboOtherTime based
on lt_TimeInterval (Short Time).
The final part of the form has cboWorkCode and an unbound textbox containing
the expression which is causing me this boundless hell that is my life. Ok
Drama over, promise.
Please understand i work for a non-profit agency, with a technophobe boss.
She CANNOT and WILL NOT EVER, EVER, EVER, nor does she want to, understand
the decimal clock. She REFUSES to convert from a decimal format to a "time
format" even when I have printed her a comparison table.
So, I HAVE to display time as 8:30 pm (Dear me, don't even start on the 24
hour clock...it's good ol' AM and PM ONLY for her!) and not 8.5, which we all
know is wonderfully summable.
This is, and *always* will be a 9-5, Monday to Friday (except for poor ol me
trying to figure this out on weekends, so I do have hours then, too) so no
need to worry about exceeding a 24 hour day or work spanning a 2 day period.
I think I understand that time is converted to a decimal format regardless
of how it looks in my combobox, but for the life of me, I cannot, even with
help, seem to get the darn expression to calculate properly...
Here is what I need to do:
1. Calculate the difference between StartTime and FinishTime and LunchTime,
and display that value in the SplitForm I am using, as well as the
TotalDailyHours Field in t_TimeSheet.
2. HOWEVER, I also need to add, on occassion, an amount of time from
cboOtherTime (which is based on the lt_TimeInterval (short time format). AND
sometimes all that I will have is Othertime (and of course the employee,
payperiod, the workdate and the workcode, which I also need to display in my
textbox expression and store in t_TimeSheet in the OtherTime field.
Okay, here is the unbound textbox expression (cannot seem to get the
epression calculated time to enter into the t_timesheet TotalDailyHours
field, even though it shows in the datasheet view of the splitform...
=IIf([OtherTime]>0,DateDiff("n",0,[OtherTime])/60,(DateDiff("n",[StartTime],[FinishTime])-Int([LunchTime])*1440)/60)
The expression will not subtract LunchTime to give the total daily hours.
It will give me ONLY the Othertime total when it is the only value chosen
(ie no starttime, lunchtime or finishtime is chosen)...this is good.
It will not, however, add the Othertime value to the StartTime LunchTime
FinishTime portion of the equation.
Finally, I need to add these values of time to produce a bi-weekly timesheet
with a subtotaled week one by workcode.
If there are any angels out there, HERE I AM, Please help me before I loose
my tiny, little mind!!!
Thank you for reading my first Novella, I hope you at least got a chuckle ot
of it...
Billiam
I have a timesheet table (t_TimeSheet) which a form is based on (f_TimeSheet).
First I have a cboEmployee based on q_Employee which is a concatenated
Employee number and name.
Next, I have a cboPayPeriodFrom based on a lookup/reference table
(lt_PayPeriod) and a cboPayPeriodTo based on the same lookup/reference table.
(Long date Format).
Next I have cboWorkDate (Longdate Format).
Next is cboStartTime based on the lookup/refernce table lt_Time (Medium
Date) , then cboFinishTime same lookup table (Medium Date) , then cboLunch
based on lt_TimeInterval (Short Time format), and finally cboOtherTime based
on lt_TimeInterval (Short Time).
The final part of the form has cboWorkCode and an unbound textbox containing
the expression which is causing me this boundless hell that is my life. Ok
Drama over, promise.
Please understand i work for a non-profit agency, with a technophobe boss.
She CANNOT and WILL NOT EVER, EVER, EVER, nor does she want to, understand
the decimal clock. She REFUSES to convert from a decimal format to a "time
format" even when I have printed her a comparison table.
So, I HAVE to display time as 8:30 pm (Dear me, don't even start on the 24
hour clock...it's good ol' AM and PM ONLY for her!) and not 8.5, which we all
know is wonderfully summable.
This is, and *always* will be a 9-5, Monday to Friday (except for poor ol me
trying to figure this out on weekends, so I do have hours then, too) so no
need to worry about exceeding a 24 hour day or work spanning a 2 day period.
I think I understand that time is converted to a decimal format regardless
of how it looks in my combobox, but for the life of me, I cannot, even with
help, seem to get the darn expression to calculate properly...
Here is what I need to do:
1. Calculate the difference between StartTime and FinishTime and LunchTime,
and display that value in the SplitForm I am using, as well as the
TotalDailyHours Field in t_TimeSheet.
2. HOWEVER, I also need to add, on occassion, an amount of time from
cboOtherTime (which is based on the lt_TimeInterval (short time format). AND
sometimes all that I will have is Othertime (and of course the employee,
payperiod, the workdate and the workcode, which I also need to display in my
textbox expression and store in t_TimeSheet in the OtherTime field.
Okay, here is the unbound textbox expression (cannot seem to get the
epression calculated time to enter into the t_timesheet TotalDailyHours
field, even though it shows in the datasheet view of the splitform...
=IIf([OtherTime]>0,DateDiff("n",0,[OtherTime])/60,(DateDiff("n",[StartTime],[FinishTime])-Int([LunchTime])*1440)/60)
The expression will not subtract LunchTime to give the total daily hours.
It will give me ONLY the Othertime total when it is the only value chosen
(ie no starttime, lunchtime or finishtime is chosen)...this is good.
It will not, however, add the Othertime value to the StartTime LunchTime
FinishTime portion of the equation.
Finally, I need to add these values of time to produce a bi-weekly timesheet
with a subtotaled week one by workcode.
If there are any angels out there, HERE I AM, Please help me before I loose
my tiny, little mind!!!
Thank you for reading my first Novella, I hope you at least got a chuckle ot
of it...
Billiam