Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Help with Time Clock Form
Julian Kinlaw 
    
8 months ago
Hello everyone, I need some help on one of my time clock forms. I have looked into various ways of doing this but not sure how to implement. It is the clock in/out form. I am using Richards clock database with a main menu and clock in/out form. I would like to have the form so if someone is clocking in the clock out button will be greyed out, unavailable. And vise versa when clock out the Clock In button will be greyed out. I know it needs to relate to the EmployeeID as knowing when someone is clocked in or out because as the form works now after clocking in the form reopens showing the person clock in that will clock out. Hope this makes sense.
Julian Kinlaw OP  @Reply  
    
8 months ago

Kevin Robertson  @Reply  
          
8 months ago
Call this sub in the Load event and in both buttons. Change the names to whatever your controls are called.

Private Sub DisableButtons()

    If IsNull(StartTime) Then
        btnClockIn.Enabled = True
        btnClockOut.Enabled = False
    ElseIf IsNull(EndTime) Then
        btnClockIn.Enabled = False
        btnClockOut.Enabled = True
    Else
        btnClockOut.Enabled = False
        btnClockIn.Enabled = False
    End If
    
End Sub
Raymond Spornhauer  @Reply  
          
8 months ago
Julian

On the Form's OnCurrent Event:

  'Start with both disabled
  Clock In button is Disabled
  Clock Out button is Disabled

  If [Time In] is empty Then
       Clock In Button is Enabled
  Else
       If [Time Out] is empty Then
            Clock Out Button is Enabled
       End If
  End If

On your Clock In Button On-Click Event:
  Set your time
  Clock In Button is Disabled
  Clock Out Button is Enabled

On your Clock Out Button On-Click Event:
  Set your time
  Clock Out Button is Disabled


This is the logic that seems correct to me.  Obviously you'll need to make this conform to the exact code.  I'm not sure if that's what you're asking as we don't have field names or design information.

Now you have to determine how to handle errors, like when an employee tells you they clicked the button, but didn't mean to.  Do you want the manager to have to fix it?  Do you want there to be a way for them to fix it?

Hope this helps,

-Raymond
Julian Kinlaw OP  @Reply  
    
8 months ago
Thanks guys. Just what I needed. Able to achieve the results I was looking for combining info from both.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/19/2026 7:54:09 AM. PLT: 1s