Timesheet entering blocks of time with a value


B

Billiam

In my timesheet, I would like to have an option to enter blocks of time at a
certain time value. I believe I will need to program this?

For example, instead of entering in a 2 week vacation/sicktime block day by
day, could I do this (each day would be 8 hours or x hours for that matter
within the block) without programming...maybe just an expression and append
table???

My form would have cbo employee based on t_employee)
cboPayperiod (based on lt_payperiod),
cboDateFrom (Date/Time, Long date Format) and
cboDateTo (Date/Time, Long date Format),
cboWorkCode (vacation,Sick etc) (based on lt_WorkCode),
cboHoursPerDay based on lt_TimeInterval, short time format).

Problem1:
How do I limit the days available OR populate the cboDateFrom and cboDateTo
so that only the days in the Payperiod are shown. If cboPayPeriod is based on
a lt_PayPeriod consisting of:

PayPeriodID, autonumber PK;
PayPeriod, text, in the form 09-01 (year 2009 payperiod 1)
PayPeriodFrom date/TimeFormat Long Time,
PayPeriodTo, date/Time format, long time.)

Problem2:

Once the values have been chosen by the employee, how do get an entry per
day by the value chosen which would be bound to t_Timesheet dateWorked field
date/Time format, long date, and field DailyHoursWorked field in the same
table Date/Time, short time (plus the payperiod and employee entries?

Is there a better way to do this? any advice and help would be appreciated
greatly.
 
Ad

Advertisements

D

Dale Fye

If I were going to implement this, I think I would base it on the Work Code.
For example, I don't think I would let the users insert a fixed # of hours
worked per day, but I would let them put in a fixed # of hours if the Work
Code is vacation, sick, ...

To do this, I would add a command button that is disabled unless the value
of the WorkCode meets your requirements. Then, in the Click event of this
button, I would check to make sure DateFrom and DateTo are valid and
DateFrom<DateTo. Then I would loop through the dates and insert a record
into the appropriate table for each of the dates in the time frame (using an
append query). Alternately, you could do this with a single query if you
have a table of numbers from say 0 to 100. In this case, the query might
look something like:

INSERT INTO yourTable (EmpID, PayPeriod, WorkDate, WorkCode, Hours)
SELECT me.txt_EmpID, me.cboPayPeriod, DateAdd("d", tblNumbers.intNumber,
me.cboDateFrom) as WorkDate, me.cboWorkCode, me.txt_Hours
FROM tblNumbers
WHERE DateAdd("d", tblNumbers.intNumber, me.cboDateFrom) <= me.cboDateTo

This assumes that the numbers table (tblNumbers) contains a field
(intNumber) with values ranging from 0 to some number large enough to account
for your extended absenses.
 
B

Billiam

Hi Dale,

Thank you very much for the deatiled answer!!! I really appreciate you
taking the time to help those of us trying to learn this stuff...I would not
be a user of Access without you and the other kind souls around here.

Will work on this tonight and see what if i can get it all working...I don't
know why I thought this would be easy! LOL.
Have a great day, and many thanks again!
Best regards,
 
Ad

Advertisements

B

Billiam

Hi Dale,

The more I thought about it, the more I decided to take my OtherTime field
off of the 'daily entry timesheet", and have a seperate form specifically for
SickTime and VacationTime, which can then be entered on the other pop-up form
as a daily event, or as a block event based upon the workcode.

will try and work this out over the next few days, and may need some
assistance when it comes to the "looping records part"...nothing a few good
backups shouldn't solve before i start "playing"...

Thanks again for you offer of help...it is my goal to msubmit this timesheet
to the Microsoft Access template Forum for others to learn from...with credit
of course to the MVP's that helped!!!

Thanks again,
Billiam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top