Automatically updating a table with default values

  • Thread starter charles.kendricks
  • Start date
C

charles.kendricks

I have a form used by employees to clock in and out to/from work. The
form updates a table which stores all the time information. The
problem is that on days that the employee would not have an entry in
the table for days that he does not work. Is there a way to
automatically update the table with some arbitrary default values for
each employee on days that they don't update the table manually (by
clocking into work)? I want an entry for each employee for every day
in the table, and on days that they don't work the fields would be
filled with a default value (#0:00#).
 
C

charles.kendricks

I have a form used by employees to clock in and out to/from work. The
form updates a table which stores all the time information. The
problem is that on days that the employee would not have an entry in
the table for days that he does not work. Is there a way to
automatically update the table with some arbitrary default values for
each employee on days that they don't update the table manually (by
clocking into work)? I want an entry for each employee for every day
in the table, and on days that they don't work the fields would be
filled with a default value (#0:00#).

Ok, so shortly after posting this topic, it came to me that I could
just build a cartesian table from a set of dates, and all the
employees with the default values for the remainder of the fields in
the table. So I wind up with a table that has an entry for each
employee (luckily we're a very small company), for each day of the
year. Then all I have to do is to use my form to update that table,
and query for the dates in question. I know this isn't very eligant,
but it seems to work.
 
B

BruceM

It's hard to know why you wish to store a placeholder record, but it's
almost certainly not necessary. Since you have not posted any information
about the structure of the database I can only read between the lines to
surmise that you are storing 365 (or 366) separate records for each employee
each year.
You would typically have an Employee table and a related table for the
amount of time worked. Your system may work for now, but unless I
completely misunderstand your approach the database could prove difficult
and time-consuming to use and maintain.
 
J

John Vinson

I have a form used by employees to clock in and out to/from work. The
form updates a table which stores all the time information. The
problem is that on days that the employee would not have an entry in
the table for days that he does not work. Is there a way to
automatically update the table with some arbitrary default values for
each employee on days that they don't update the table manually (by
clocking into work)? I want an entry for each employee for every day
in the table, and on days that they don't work the fields would be
filled with a default value (#0:00#).

I'm with Bruce. I cannot see ANY advantage to these "placeholder"
records. A Query using Left Joins if necessary will return all your
employees, whether they work or not. What *problem* are you trying to
solve by adding these meaningless records?

John W. Vinson[MVP]
 

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