Go Back   Access World Forums > Microsoft Access Reference > Sample Databases

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 02-05-2019, 10:40 PM   #1
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 774
Thanks: 38
Thanked 31 Times in 26 Posts
MickJav is on a distinguished road
Re: Employee System Example V2

The Holiday Planner originally by peter hibbs UttaAccess https://www.utteraccess.com/forum/in...wtopic=2001188


this also includes a version on the calendar but updated to work with this project https://www.access-programmers.co.uk...d.php?t=303130


Updates Include:
  1. Updated UI
  2. Yearly Holiday Allotments
  3. Number of holidays still available
  4. Half days or full days holidays
  5. Takes into account Company shutdowns, Public holidays
  6. weather company pays for public holidays or uses your allotment
  7. Holidays Requests system
Should you find an error or just have questions please use the topic below:
https://www.access-programmers.co.uk...d.php?t=303140


Error Info/Corrections
In modgeneral, function CheckDates
Replace If CR = 0
With If CR <= 0
It may be possible for the function to return a value less than 0 when dealling with half days holidays

On frmMain control CmdPlanner
Add L = False Above DoCmd.OpenForm "frmHolidays"
That will correct the admin display all records or assigned departments only


THIS VERSION HAS NOW BEEN UPDATED PLEASE DOWNLOAD VERSION 3 FROM HERE:
https://www.access-programmers.co.uk...02&postcount=6
Attached Images
File Type: png 2019-02-05.png (57.0 KB, 187 views)
File Type: png 2019-02-05 (2).png (96.3 KB, 150 views)
File Type: png 2019-02-05 (1).png (46.2 KB, 140 views)


Last edited by MickJav; 05-19-2019 at 06:15 AM.
MickJav is offline   Reply With Quote
The Following 3 Users Say Thank You to MickJav For This Useful Post:
masa1 (02-10-2019), mrcunknown (02-26-2019), Tera (02-13-2019)
Old 02-21-2019, 01:27 PM   #2
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 774
Thanks: 38
Thanked 31 Times in 26 Posts
MickJav is on a distinguished road
Re: Employee System Example V2

This is an updated version of the employees example which now includes a works Diary I have also added a manual which I hope you find helpful.

Updates Include:
  1. Works Diary
  2. Meetings System
  3. Groups/Tasks From peter Hibbs Gantt chart
  4. Updates to holiday edit screen
  5. Updates to employees screen
  6. User Manual



If you like what I've done please come back and let me know by clicking the thanks button


THIS VERSION HAS NOW BEEN UPDATED PLEASE DOWNLOAD VERSION 3 FROM HERE:
https://www.access-programmers.co.uk...02&postcount=6
Attached Images
File Type: png 2019-02-21 (16).png (50.4 KB, 1112 views)

Last edited by MickJav; 05-19-2019 at 06:31 AM.
MickJav is offline   Reply With Quote
The Following 3 Users Say Thank You to MickJav For This Useful Post:
masa1 (02-21-2019), mrcunknown (02-26-2019), riti90 (02-22-2019)
Old 02-23-2019, 06:58 AM   #3
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 774
Thanks: 38
Thanked 31 Times in 26 Posts
MickJav is on a distinguished road
Re: Employee System Example V2

Error Correction:


Form frmMain, Control CmdMeetings


Add the following function to modDiary


Code:
Public Function GetEmpMeetings() As String
Dim R As DAO.Recordset
Dim SW As String
'QryMeetingsList Is a non updatable query but is designed to be used for opening the meetings forms after finding the attending employee for that meeting
Set R = CurrentDb.OpenRecordset("SELECT MeetingID FROM QryMeetingsCal WHERE [EmployeeID]=" & Forms!frmMain!EmployeeID, dbOpenSnapshot)
    Do While Not R.EOF
        SW = SW & " Or [MeetingID]=" & R("MeetingID") 'Create A Where String Of all the meetings for this employee
    R.MoveNext
    Loop
    SW = Right(SW, Len(SW) - 4) 'Remove " Or " from the begining of the sting
    GetEmpMeetings = SW  'add the sting
End Function
Add following code to cmdMeetings onclick event
Code:
On Error GoTo HandleErr
    

    DoCmd.OpenForm "frmMeetingsList", , , GetEmpMeetings

HandleExit:
    Exit Sub
    
HandleErr:
    Select Case Err.Number
        Case 2501 'Cancel = True
            Exit Sub
        Case 5 'Invalid procedure call
            MsgBox "No Records Found"
            Exit Sub
        Case Else
            MsgBox Err.Number & vbCrLf & Err.Description
            Resume HandleExit
        Resume
    End Select


Last edited by MickJav; 02-23-2019 at 10:41 AM.
MickJav is offline   Reply With Quote
Old 04-08-2019, 11:34 PM   #4
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 774
Thanks: 38
Thanked 31 Times in 26 Posts
MickJav is on a distinguished road
Re: Employee System Example V1

Error Correction


In form frmHolidays
Form_Open


Add below
On Error GoTo HandleErr

HalfDayStart = 0
HalfDayEnd = 0




if you have allowHalfDays set false then the above two can = empty which the Nz function doesn't seem to like as empty and null are not the same thing


This error only seems ho happen if you use the drag accross the field method which is only used if half days are set true


To make this error happen do the following

  1. open db make sure company allows half days is unticked save changes if using example
  2. open the holiday Planner
  3. select leave type of sick leave
  4. then use the drag method to create leave in a field



I have left the NZ funtions in the update statment but they shouldn't be needed in the cmdDates_MouseUp sub
__________________
DD's Simple Home Accounts:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

DD's Book Library:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Under Development DD's Works Manager Due end August 2019, DD's Employee Works Rota Demo Expected 2020

Last edited by MickJav; 04-09-2019 at 01:19 PM.
MickJav is offline   Reply With Quote
Old 05-17-2019, 02:04 AM   #5
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 774
Thanks: 38
Thanked 31 Times in 26 Posts
MickJav is on a distinguished road
Re: Employee System Example V1

Error Correction:
I know when tested the dlookup worked but was working on an update and found it didn't work, I changed it for a recordset with the exact same expression which worked.
I don't understand why the Dlookup don't like the date part of the expression maybe somebody will take a look and see something I missed


Replace The DoRemoveEntry Function which I have also noticed should be a sub



Code:
Private Sub DoRemoveEntry(T As Integer)
Dim A As Long
Dim C As DAO.Recordset

On Error GoTo HandleErr

Set C = Me.RecordsetClone

If MsgBox("You are about to remove the entry for" & vbCrLf & "Employee: " & Me.EmployeeName & _
            vbCrLf & "Date: " & Forms!frmDiary!txtDate & vbCrLf & "Time: " & Format(T & ":00", "h AM/PM") & vbCrLf & _
            "ARE YOU SURE YOU WISH TO REMOVE THIS ENTRY", vbCritical + vbYesNo, "Delete Warning") = vbYes Then
    'Answer was yes so delete the entry
    Set C = CurrentDb.OpenRecordset("SELECT * FROM QryAttendingFind WHERE [TimeID]=" & T & " AND [EmployeeID]=" & Me.EmployeeID & " AND [MeetingDate]=" & Format(Forms!frmDiary!txtDate, "\#mm\/dd\/yyyy\#"))
    If C.RecordCount = 1 Then
     A = C("AttendingID")
    Debug.Print A
     CurrentDb.Execute ("DELETE * FROM tblAttending WHERE [AttendingID]=" & A)
    End If
    CurrentDb.Execute ("DELETE * FROM tblTimeSlots WHERE [TimeID]=" & T & " AND [Employee]=" & Me.EmployeeID & " AND [SlotDate]=" & Format(Forms!frmDiary!txtDate, "\#mm\/dd\/yyyy\#"))
    Forms!frmDiary!CboType = Null
    Me.Painting = False 'Suspend Form Painting
        ShowData Forms!frmDiary!txtDate  'Redisplay the data
    Me.Painting = True  'Re-enable painting
    
C.Close
Set C = Nothing
End If

HandleExit:
    Exit Sub
    
HandleErr:
    Select Case Err.Number
        Case 2501 'Cancel = True
            Exit Sub         'So as the forms been told to close just exit all good
        Case Else
            MsgBox Err.Number & vbCrLf & Err.Description
            Resume HandleExit
        Resume
    End Select
End Sub
One other update related to the meetings may save some confusion link the meetings list combo with the date so only meetings on that day will display as I only designed the meetings as a short system with meetings lasting only a few hours but didn't allow for them being reused

Replays here: https://www.access-programmers.co.uk...d.php?t=303140
__________________
DD's Simple Home Accounts:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

DD's Book Library:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Under Development DD's Works Manager Due end August 2019, DD's Employee Works Rota Demo Expected 2020
MickJav is offline   Reply With Quote
Old 05-19-2019, 05:46 AM   #6
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 774
Thanks: 38
Thanked 31 Times in 26 Posts
MickJav is on a distinguished road
Re: Employee System Example V1

I have added a new version of this project that includes all know error corrections


I have also added ribbon code and table these are credit thedbGuy.
Attached Files
File Type: zip Employee Demo V3.zip (880.9 KB, 146 views)

__________________
DD's Simple Home Accounts:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

DD's Book Library:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Under Development DD's Works Manager Due end August 2019, DD's Employee Works Rota Demo Expected 2020
MickJav is offline   Reply With Quote
Reply

Tags
list box

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move Employee Multiple employee eyeseven2014 Forms 3 04-06-2014 09:55 PM
Employee HR Database (Employee Hierarchy). andmunn Tables 10 02-03-2014 03:38 AM
Accde made on developement system does not fully work on client system a.sharma Modules & VBA 8 05-03-2013 05:38 AM
To record Employee transfer date OR to record employee title? degremont Tables 2 10-23-2008 05:38 PM




All times are GMT -8. The time now is 03:40 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World