I am fairly new to MS Access and VB but thanks to many of the posts on
this site I have found solutions to my problems. I have been searching
all day, however, for an answer to my current problem but I haven't
found anything so I have joined and I hope someone can help me.
I have a form with the field [EmployeeName] and many buttons. Currently
one button "Clock IN" opens another form in add mode then autopopulates
the [EmployeeName] field with the same name on the previous form.
On this new form there are three fields:
1) Date
2) TimeIN
3) TimeOUT
There is also a button "Clock In." When Clock in is pressed the date
and TimeIN fields are populated with the current date and time, and the
button now displays "Clock Out." If the employee pushes the button
again it will fill in the TimeOUT field. Every time this is done it
creates a new record in the table "Time" includin Name, Date, TimeIN,
and TimeOUT.
The problem is that after the employee clocks in they will close the
form and then when they come back in to clock out they will have to
reopen the form. Since the form is in add mode it just creates a new
record instead of going back to their previous record where the TimeOUT
field is Null.
Is there a way that the button on the first form will:
1) Open the second form using the current Employee's name
2) Check to see if THIER last entry has a null value in the TimeOUT
field
3) If it does then open that record and if it doesn't add new record
using current Employee name
I hope this all made sense
Thanks,
Shawn Yates
this site I have found solutions to my problems. I have been searching
all day, however, for an answer to my current problem but I haven't
found anything so I have joined and I hope someone can help me.
I have a form with the field [EmployeeName] and many buttons. Currently
one button "Clock IN" opens another form in add mode then autopopulates
the [EmployeeName] field with the same name on the previous form.
On this new form there are three fields:
1) Date
2) TimeIN
3) TimeOUT
There is also a button "Clock In." When Clock in is pressed the date
and TimeIN fields are populated with the current date and time, and the
button now displays "Clock Out." If the employee pushes the button
again it will fill in the TimeOUT field. Every time this is done it
creates a new record in the table "Time" includin Name, Date, TimeIN,
and TimeOUT.
The problem is that after the employee clocks in they will close the
form and then when they come back in to clock out they will have to
reopen the form. Since the form is in add mode it just creates a new
record instead of going back to their previous record where the TimeOUT
field is Null.
Is there a way that the button on the first form will:
1) Open the second form using the current Employee's name
2) Check to see if THIER last entry has a null value in the TimeOUT
field
3) If it does then open that record and if it doesn't add new record
using current Employee name
I hope this all made sense
Thanks,
Shawn Yates
Comment