Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Posts
    5

    Command button code

    Hi,


    i've created a simple time clock form which has a main form and a subform (wiht the punch details). ON the main form I have a command buttons such as Clock IN - Clock OUT etc. When they click on Clock IN I want to verify that they have not ALREADY clocked in (they shouldn't be allowed to clock IN twice). What is the best way to do this?

  2. #2
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109

    Need a little more information

    What happens when someone clocks in or out?

    For instance, if you fill out a field, I would check if the field is empty. If you are adding a record, I might check the recordset count. If you are storing a list of date and times, I would run a sql query to see if that information was already entered for that date.

  3. #3
    Join Date
    Mar 2008
    Posts
    5
    When they clock in it records the date/time in a record with the emp# etc. The record has fields for multiple clock out's and in's for lunch, breaks etc. I want to check when they click the Start Shift button that they haven't already clocked in for that. I also want to check on the other buttons (clock out for lunch, back from lunch, end shift).

  4. #4
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109

    One Option

    I don't know if this is the best way, but I would run a SQL query to see if a clock in entry had been made for the employee on today's date. If no entry had been made, perform your clock in operation.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Execute Command Interactively
    By zephaneas in forum Programming
    Replies: 1
    Last Post: 11-08-2008, 09:56 AM
  2. Duplicate command button
    By brettg in forum Database Design
    Replies: 1
    Last Post: 08-04-2008, 04:16 AM
  3. Command button for time & date
    By joet5402 in forum Forms
    Replies: 2
    Last Post: 12-20-2007, 02:59 AM
  4. command button to filter a subform issue -
    By countdrako in forum Forms
    Replies: 1
    Last Post: 12-09-2005, 11:58 PM
  5. Open a linked subform with a command button
    By flablueeyedblond in forum Forms
    Replies: 0
    Last Post: 11-18-2005, 01:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums