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 
Time Clock on Form
James Hopkins 
     
2 years ago
Hey Richard and the Guys, I am wondering if there's a way to use a Time Clock Display to Clock on a Schedule Event. Then captive the Data and input it it the Timesheet Table. Cause I try to use the 'Scheduled Event Information Form' I created to Clock In on and Out of the Event.
Richard Rost  @Reply  
          
2 years ago
James Hopkins OP  @Reply  
     
2 years ago
I got an Error Message...
James Hopkins OP  @Reply  
     
2 years ago

James Hopkins OP  @Reply  
     
2 years ago

James Hopkins OP  @Reply  
     
2 years ago

James Hopkins OP  @Reply  
     
2 years ago

James Hopkins OP  @Reply  
     
2 years ago

James Hopkins OP  @Reply  
     
2 years ago

James Hopkins OP  @Reply  
     
2 years ago
Hey Guys, if I use an Subform on the 'ScheduleInformationViewF. and remove the DisplayTime and StartWork Button. Put them on the Subform. Then use Recordsets in the Button to input a New Line of the TimesheetT for the Schedule Event that is Showing on the 'ScheduleInformationViewF'?
Richard Rost  @Reply  
          
2 years ago
Is this a BOUND form?
James Hopkins OP  @Reply  
     
2 years ago
Yes, it is Bound toa Query
Richard Rost  @Reply  
          
2 years ago
Is that field editable in the query? See Not Updateable
James Hopkins OP  @Reply  
     
2 years ago
Rick, I think so, could i can make changes in the Query Datasheet View.
I changed the 'ClockOut' and ClockIn fields to UNBOUND and changed the 'DisplayTime' to a Live Clock type. I think I may have to use Recordset the Input the Data back into the 'TimesheetT' when Starting Work and Ending Work.
James Hopkins OP  @Reply  
     
2 years ago
Also Guys, I was trying to use the 'DisplayTime' as an Stop Watch type. So I could capture the Time Duration.
James Hopkins OP  @Reply  
     
2 years ago
This is the VBA Code I created so far, but the Update the last Timesheet Entry of the Current Record. Is not work correctly.

DetailsPrivate Sub BtnStartStopWork_Click()

    If IsNull(ScheduleID) Then Exit Sub
    
    Dim rsUpdateTime As Recordset
    Dim rsTime As Recordset
    
    Set rsUpdateTime = CurrentDb.OpenRecordset("TimesheetT")
    Set rsTime = CurrentDb.OpenRecordset("TimesheetT")
                
    If BtnStartStopWork.Caption = "Start Work" Then
        
        BtnStartStopWork.Caption = "Stop Work"
        BtnStartStopWork.BackColor = vbRed
        BtnStartStopWork.HoverColor = vbRed
        ClockIn = Now()
        Me.Refresh
        
        BtnStartStopWork.Transparent = False
        DisplayTime.Visible = True
        
        Dim TimesheetIDNumber As String
        
        TimesheetIDNumber = Nz(DMax("TimesheetIDNumber", "TimesheetT"), 0)
        rsTime.AddNew
        rsTime!TimesheetIDNumber = TimesheetIDNumber + 1
        rsTime!EmployeeID = EmployeeID
        rsTime!ScheduleID = ScheduleID
        rsTime!TimesheetCategoryID = 265
        rsTime!ClientID = ClientID
        rsTime!PropertyID = PropertyID
        rsTime!ClockIn = ClockIn
        rsTime!ClockInUTC = ClockInUTC
        rsTime!TimesheetStartDate = TimesheetStartDate
        rsTime!TimesheetStartTime = TimesheetStartTime
        rsTime!TimeClockStatus = "Clock-In"
        rsTime!TimesheetStatusID = 282
        rsTime.Update
            
        rsTime.Close
        Set rsTime = Nothing
    
    ElseIf BtnStartStopWork.Caption = "Stop Work" Then
    
        BtnStartStopWork.Caption = "Start Work"
        BtnStartStopWork.BackColor = vbGreen
        BtnStartStopWork.HoverColor = vbGreen
        ClockOut = Now()
        Me.Refresh
        
        BtnStartStopWork.Transparent = True
        BtnStartStopWork.Enabled = False
        DisplayTime.Visible = False
        
        Dim TimesheetID As Integer
        
        TimesheetID = DMax("TimesheetID", "TimesheetT")
        
        rsUpdateTime.FindFirst ("TimesheetID")
        
        rsUpdateTime.Edit
        rsUpdateTime!ClockOut = ClockOut
        rsUpdateTime!ClockOutUTC = ClockOutUTC
        rsUpdateTime!TimesheetEndDate = TimesheetEndDate
        rsUpdateTime!TimesheetEndTime = TimesheetEndTime
        rsUpdateTime!TimesheetStatusID = 282
        rsUpdateTime!TimeClockStatus = "Clock-Out"
        rsUpdateTime.Update
        
        rsUpdateTime.Close
        Set rsUpdateTime = Nothing
        
    End If
  
End Sub
Richard Rost  @Reply  
          
2 years ago
Adding a new record with a recordset doesn't MOVE the form to that record. If it's a bound form, get rid of the recordset and just DoCmd.GoToRecord a new record.

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/6/2026 4:33:07 AM. PLT: 0s