store multiple timestamps in one row on table

R

roostorx

Hello,

I am trying to create a form that allows an employee to select their
name and click a command button to store the time they leave for lunch
and another button the time that they return. I have each button
coded to be written to a table, but I would like to have the in and
out times be stored on the same row so I can have a function subtract
the two. Currently, it writes a new row for each click of the
button. Any help would be appreciated.
 
J

John W. Vinson

Hello,

I am trying to create a form that allows an employee to select their
name and click a command button to store the time they leave for lunch
and another button the time that they return. I have each button
coded to be written to a table, but I would like to have the in and
out times be stored on the same row so I can have a function subtract
the two. Currently, it writes a new row for each click of the
button. Any help would be appreciated.

A new row for each departure and each return would not prohibit your function
from doing the calculation. You should certainly NOT have multiple (more than
two, in-out) timestamps per record!

I'd leave it with one timestamp per record, and use a "Self Join" query to
match each arrival with its corresponding departure.

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