Hi,
As you say that you are a novice in Access I'm going to attach a Microsoft example of a Time and Billing system to give you some idea of what might be achieved. In it's original form it did not the data logging that you require but I have started to extend it.
This system accumulates hours to specic tasks and calculates charges to be billed back to the project. Each project is identified to a customer. It also accumulates other expenses in addition to labour charges. So it is probably doing much more than you currently require.
The naming of tables, forms, queries and reports seems to be aimed at giving clarity to their function rather than the more generally adopted convention of prefixing each with tbl, frm, qry and rpt; and removing spaces.
One neat trick, that is used to copy the Billing Rate from an Employee to a task, is to use a hidden column in the combo box (see if you can find it!) This is easy in access but I've never managed it in VB.
To extend this application to your requirement you will need to capture two extra fields (called say StartTime and FinishTime) I think you have two options. The first would be just to add them to the table [Time Card Hours]. The existing field [Billable Hours] would then have to be calculated.
(Time passes. . . while I check viability )
OK, I've just tested out these thoughts and they are now incorporated in the attached application. When it opens click on the Time Cards button and then add an entry. Double click on StartTime and the current time will be entered. Let time pass then double click on EndTime. The new current time will be entered then the BillingHours will be calculated. I've added code to round the times to nearest quarter hour, to avoid silly decimals (Write your own). The added code is something like this
- Private Sub StartTime_DblClick(Cancel As Integer)
-
Me.StartTime = Now()
-
End Sub
-
-
Private Sub EndTime_DblClick(Cancel As Integer)
-
-
If IsNull(Me.StartTime) Then
-
MsgBox "Please enter a Start Time", vbCritical, "No Start Time"
-
Me.StartTime.SetFocus
-
Exit Sub
-
End If
-
-
Me.EndTime = Now()
-
checkHours
-
End Sub
-
-
Private Sub checkHours()
-
-
Dim WholeHours As Integer
-
Dim WholeMinutes As Integer
-
Dim DeciHours As Single
-
-
WholeHours = DateDiff("h", Me.StartTime, Me.EndTime)
-
WholeMinutes = DateDiff("n", Me.StartTime, Me.EndTime) Mod 60
-
-
If WholeMinutes < 15 Then
-
DeciHours = 0
-
ElseIf WholeMinutes >= 15 Then
-
DeciHours = 0.25
-
ElseIf WholeMinutes >= 30 Then
-
DeciHours = 0.5
-
ElseIf WholeMinutes >= 45 Then
-
DeciHours = 0.75
-
ElseIf WholeMinutes > 55 Then
-
DeciHours = 1#
-
End If
-
-
Me.BillableHours = WholeHours + DeciHours
-
-
End Sub
This is just a demo to give you some ideas. I don't think you can see the time card for a person for a particular week.
All users can see everything. This is OK if a clerk is entering the data but may need revising so general users only see their own time card. I would certainly consider a simplified input-form.
When I first looked at this I was considering adding a new table to hold the Start and End times (option 2 above), then rolling-up the bookings for a single day per Employee. But at the moment I cannot see many advantages in complicating the matter and wait for some initial feed-back
S7