Show logged on employee on a list box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings everyone!

I have a bundy clock application and it's currently working perfectly.
However, I want to add a list box in a form called "Bundy Clock" and show in
that list box who has logged in so employees may also know that they are
logged in and double logging would be avoided. Any help will highly be
appreciated.

Thank you very much!
 
Greetings everyone!

I have a bundy clock application and it's currently working perfectly.
However, I want to add a list box in a form called "Bundy Clock" and show in
that list box who has logged in so employees may also know that they are
logged in and double logging would be avoided. Any help will highly be
appreciated.

Thank you very much!

How, in your table, does "logged on" get stored?

John W. Vinson [MVP]
 
I have Employee Id and passcode fields and when they press Enter, it will
check if the employee id matches the passcode. If it does, a form will open
with the employee's picture, name, position and the current date and time.
when he press the Enter key again, the form will close and the bundy clock
form will open to accomodate the next employee.

In my table, I have the following fields: Date Worked, Am_In,
Am_Out,Pm_In,Pm_Out. In the morning, when the employee logs on, I have a
macro that sets the value of the Am_in to Time().

Scenario:
MORNING:
The employee will enter his employee id and passcode. upon pressing the
enter key, Access will check if the employee Id and passcode match. If it
matched, another form called "Time In" will open showing the employee ID,
name, photo, position and etc. When he press the enter key, a macro on the
afterUpdate Event fires and stamp the Am_In field in my table with the
current time.
 
I have Employee Id and passcode fields and when they press Enter, it will
check if the employee id matches the passcode. If it does, a form will open
with the employee's picture, name, position and the current date and time.
when he press the Enter key again, the form will close and the bundy clock
form will open to accomodate the next employee.

In my table, I have the following fields: Date Worked, Am_In,
Am_Out,Pm_In,Pm_Out. In the morning, when the employee logs on, I have a
macro that sets the value of the Am_in to Time().

It will be a lot simpler if you use a single date/time field to store both the
date and the time - to make searching easier and to prevent problems with
shifts running over midnight. If you had a field EmployeeID, TimeIn and
TimeOut, you could set TimeIn to Now() when they log in (e.g. #8/15/2007
07:44:28#). The logout scenario would have them open a Form based on a query
with their employeeID as a criterion, and IS NULL as the time out field
criterion; this form will (hopefully!) show just one record, the login without
a corresponding logout.

A Query

SELECT Employees.LastName & ", " & Employees.LastName, Bundy.TimeIn
FROM Employees INNER JOIN Bundy
ON Employees.EmployeeID = Bundy.EmployeeID
WHERE Bundy.TimeOUt IS NULL
ORDER BY TimeIn;

will show all employees who have clocked in but not yet clocked out.

You could also have a check on the login form to bring up a warning if someone
tries to log in twice, using the same or a similar query.

John W. Vinson [MVP]
 
Hi, John!

Your code works fine but it returns all the records. I just want to return
employees who are logged on for the day. Any work around on this one?

Thanks again!
 
Hi, John!

Your code works fine but it returns all the records. I just want to return
employees who are logged on for the day. Any work around on this one?

The code should work - IF you have updated all the records in the table to
include the date, not just the time.

Perhaps you could post the query in SQL view.

You may need to add an additional criterion

TimeIn >= Date()

to select only those logins that have occurred today.

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

Back
Top