Multiple dates

A

accessboy

I am building a database that tracks empl;oyee sick time. I've inserted a
popup calendar that populates the date field on the form. That date field
populates a form on the table. When I update the date field (another sick
day), it deletes the last date on the form and on the table. How can I have
the form accept multiple dates, accepting the new dates and inserting it on
the tablem but updateing the date on the form?
 
N

Niklas Östergren

How is your table-structure looks like and what are the relationships
between the tables?

How many fields per record are you populating with dates? Each new sick
day-date have to go in it´s own record. So each time you enter a new date
for a sick-day you have to create a new record. But everything haves to do
with the tablestructure of your db. So I´d like to have more info. to be
able to understand your problem properly.

// Niklas
 
T

tina

you've described a one-to-many relationship between employees and
occurrences (sick days). one employee may have many occurrences, but each
occurrence belongs to only one employee. check your current table design to
see if it matches the example below (the names you use are not important,
it's the structure that matters):

tblEmployees
EmpID (primary key)
EmpFirstName
EmpLastName
any other fields that describe an employee.

tblOccurrences
EmpIDfk (foreign key from tblEmployees)
OccurDate
any other fields that decribe an employee's occurrence.
if an employee can have only one occurrence on a given date, then you can
use the EmpIDfk and OccurDate fields as a combination primary key.
otherwise, you can add an OccurID field as primary key.

in the Relationships window, link tblEmployees to tblOccurrences on the
EmpID/EmpIDfk fields. enforce referential integrity.

you can model the tables' relationship with a standard mainform/subform
setup. the main form is bound to tblEmployees. the subform is bound to
tblOccurrences. you can go to the record of any employee in the main form,
and enter as many occurrence records in the subform as you need to.

hth
 
A

Allen Browne

You need 2 tables:
- Employee table, with EmployeeID as primary key.
- Sick table, with EmployeeID as foreign key.
One employee can then be sick many times.

For the interface, you will have a main form bound to the Employee table,
with a subform bound to the Sick table. You can add as many rows as you need
to the subform, with different dates.

If you put the cursor in the new record row (last one in the subform) before
you pop up your calendar, the pop up should then return the date into the
new row. If your calendar is not doing that for you, try this one:
http://members.iinet.net.au/~allenbrowne/ser-51.html
 
Top