Thanks Rob, I'll try to give you a little more detail now.
What I am doing is creating an employee tracking form for stations. So
simply there is a station that needs to be monitored for every second of the
day. It's not a payroll thing. Employees relieve each other from this
station. My controls on the form are;
[EmployeeName], [Date], [StartTime] and [EndTime]
You have cleared up the start time for me and it works great. Now that every
second needs to be accounted for I was wondering if when an employee gets
relieved, thier sign in time (which is automated now) could also be the end
time of the previous entry. I have the form records sorted by date and time
(Decending)
I hope this is enuff enty, please le tme know if not. this is my last on the
list for this database,lol THANKS!!
Well, it's a little clearer now, but at the moment I've still got only some
general comments.
I assume that the controls on the form are bound to fields in an underlying
table (or query) with those names for the fields. I also assume that the
tble fields for [Date], [StartTime] and [EndTime] are date/time datatypes.
If not, they should be. [As an aside, are you aware that internally Access
stores a date/time value as a double precision number, with the date being
the integer portion as days since 30 December 1899, and the time being the
decimal portion, as a proportion of 24 hours (eg. 1.75 is 18:00:00 (or 6 PM)
on 31-Dec 1899).] Using "Date" as a fieldname should be avoided - it's a
reserved word in Access (refers to the Date function, which returns the
current system date), and using it as a fieldname is simply asking for
trouble when you start using any expressions or code. Additionally, you do
not need a separate Date field and StartTime field - a single datetime
variable can store all this information (in fact, using Now() to enter the
StartTime is storing both the date and time into the StartTime field).
Also, if you must store both start and end times (see next para), using a
single date/time record makes calculation of duration simple - and not doing
so makes them considerably more complicated ;-). If you want/need it, your
form can display the same data in more than one control, with different
formats (eg. a long date format for a textbox displaying only the date
portion of the data, and a time format for the textbox displaying the start
time).
I guess the important question is "Why bother storing the end time?". If
you are assuming that one sign-on time is the same as the previous sign-off
time, there is no need to store this data at all; it is redundant data. If
you need it (eg. in a separate report to show times worked for particular
employees), you can easily calculate it in a query. The only reason it
might be useful is if an employee leaves before someone else arrives. If
that's the case, and they are actually entering their endtime, you certainly
don't want that overwritten by the next person's start time.
Again, HTH,
Rob
> Thanks Rob, I'll try to give you a little more detail now.
>
[quoted text clipped - 142 lines]
>> >> >> > greatly
>> >> >> > appreciated.