+- +-

Fiverr

Stats

Members
Total Members: 39
Latest: robw
New This Month: 11
New This Week: 1
New Today: 0
Stats
Total Posts: 321
Total Topics: 131
Most Online Today: 2
Most Online Ever: 25
(February 16, 2020, 02:51:53 pm)
Users Online
Members: 0
Guests: 0
Total: 0

DD's Top Posters

Michael
Posts: 339
borobutch
Posts: 7
ComputerTech
Posts: 4
akbarmahfuzalam
Posts: 1
richardsoj
Posts: 1
robw
Posts: 1
ranman256
Posts: 1

Author Topic: Employee System Example V4 Errors And Corrections  (Read 343 times)

0 Members and 0 Guests are viewing this topic.

Offline Michael

  • Administrator
  • Sr. Member
  • *****
  • Posts: 339
  • Karma: +2/-0
  • Gender: Male
  • Db Dreams Owner
  • Location: Margate, Kent, UK
  • Referrals: 8
Employee System Example V4 Errors And Corrections
« on: September 01, 2019, 11:08:09 am »
The following error has been found.

when openning the timesheet as a person without the correct permision it will be sent into a loop as the openning of it is being controled by the load data message the correction is to remove the following lines of code from the time sheet on open event and past in the on open event of the Msgloadingdata form.

Should you need help create a topic and I'll help best I can this topic is for notifcations and corrections only

Code: [Select]
    If Not IsOpen("frmDetectIdleTime") Then
        MsgBox "You must open this object from the main screen", vbExclamation + vbOKOnly, "Missing Object"
        Cancel = True
        Exit Sub
    End If
    'Only Managers or above can view this object
    If Not CheckManager Then
        MsgBox "You must be a manager or admin to view the Works Diary", vbExclamation + vbOKOnly, "insufficient permissions"
        Cancel = True
        Exit Sub
    End If

Past the following into the MsgfrmLoadingData form OnOpen Event

Code: [Select]
On Error GoTo HandleErr

    If Not IsOpen("frmDetectIdleTime") Then
        MsgBox "You must open this object from the main screen", vbExclamation + vbOKOnly, "Missing Object"
        Cancel = True
        Exit Sub
    End If
    'Only Managers or above can view this object
    If Not CheckManager Then
        MsgBox "You must be a manager or admin to view the Works Diary", vbExclamation + vbOKOnly, "insufficient permissions"
        Cancel = True
        Exit Sub
    End If

HandleExit:
    Exit Sub
   
HandleErr:
    Select Case Err.Number
        Case 2501 'Cancel = True
            Exit Sub
        Case Else
            MsgBox Err.Number & vbCrLf & Err.Description
            Resume HandleExit
        Resume
    End Select
« Last Edit: September 01, 2019, 11:14:45 am by Michael »

Share on Facebook Share on Twitter

Love Love x 1 View List

Offline Michael

  • Administrator
  • Sr. Member
  • *****
  • Posts: 339
  • Karma: +2/-0
  • Gender: Male
  • Db Dreams Owner
  • Location: Margate, Kent, UK
  • Referrals: 8
Re: Employee System Example V4 Errors And Corrections
« Reply #1 on: September 05, 2019, 07:36:43 pm »
Please note the error info relating to the popup calendar

https://www.utteraccess.com/forum/index.php?showtopic=2034523&view=findpost&p=2696360
Love Love x 1 View List

Offline Michael

  • Administrator
  • Sr. Member
  • *****
  • Posts: 339
  • Karma: +2/-0
  • Gender: Male
  • Db Dreams Owner
  • Location: Margate, Kent, UK
  • Referrals: 8
Re: Employee System Example V4 Errors And Corrections
« Reply #2 on: September 07, 2019, 10:36:55 am »
I was going though my project management system updating the holiday planner to current version when I noticed the holiday report was showing all entries for all years as my project management system goes back a lot of years it was a lot.

so I made the following change to the query: qryHolidayListReport

I added a new field with the expression: HYear: Year([StartDate]) you can call it what you like

And A Criteria: Year([Forms]![frmHolidays]![txtDate])

For those new to access what this does is limits the output of the report to the current year being viewed on the holiday planner, I didn't think it needed a date range popup.

P.S. I used the start date only as I was only interested in holidays starting in a given year.

hope you find this of use mick
« Last Edit: November 17, 2019, 10:59:26 pm by Michael »

Offline Michael

  • Administrator
  • Sr. Member
  • *****
  • Posts: 339
  • Karma: +2/-0
  • Gender: Male
  • Db Dreams Owner
  • Location: Margate, Kent, UK
  • Referrals: 8
Re: Employee System Example V4 Errors And Corrections
« Reply #3 on: September 14, 2019, 04:57:32 pm »
Just had an error reported this was missed between updates

open frmRequests in design view then edit the row source SQL
You can replace it with the below which points the assigned manager to the hidden form holding the defaults.

Code: [Select]
SELECT tblHolidayRequests.RequestID, tblEmployees.EmployeeID, [FirstName] & " " & [LastName] AS Employee, tblHolidayRequests.StartDate, tblHolidayRequests.EndDate

, tblHolidayRequests.HolidayNotes, tblHolidayRequests.HolidayType, tblHolidayRequests.StartHalfDay,

 tblHolidayRequests.EndHalfDay, tblHolidayRequests.ManagerID, tblHolidayRequests.Approved,

tblHolidayRequests.AssessedDate, tblHolidayRequests.ManagerNote FROM tblEmployees INNER JOIN

 tblHolidayRequests ON tblEmployees.EmployeeID = tblHolidayRequests.EmployeeID WHERE

(((tblHolidayRequests.ManagerID)=[Forms]![frmDetectIdleTime]![txtUser]) AND

((tblHolidayRequests.Approved) Is Null)) ORDER BY tblHolidayRequests.StartDate DESC

, tblHolidayRequests.Approved DESC;


Or just replace the manager ID Criteria with this [Forms]![frmDetectIdleTime]![txtUser] this will point it in the correct place.


plus also noticed the subform was not updating after adding a request so add the following to  frmMain

Replace CmdRequest Code with
Code: [Select]
    DoCmd.OpenForm "frmHolidayRequests", , , , , acDialog
    Me.ZfrmRequests.Form.Requery

« Last Edit: October 04, 2019, 09:59:08 pm by Michael »
Informative Informative x 1 View List

Offline Michael

  • Administrator
  • Sr. Member
  • *****
  • Posts: 339
  • Karma: +2/-0
  • Gender: Male
  • Db Dreams Owner
  • Location: Margate, Kent, UK
  • Referrals: 8
Re: Employee System Example V4 Errors And Corrections
« Reply #4 on: October 04, 2019, 09:57:23 pm »
On the diary, add meeting Found this error

Don't quite know what I was thinking but corrected now

comment out or remove this text  - NightShift 'M Javes Edit 16/08/2019
from this line  !StartTime = Format(ST & ":00", "h AM/PM") ' - NightShift 'M Javes Edit 16/08/2019

The meeting after adding a new one should open when first created so you can edit it once done close it make sure it is selected in the Active meetings Dropdown
for that day then just double click the time for each employee you wish to attend.

remember you can only get to r add meetings by selecting CODE ENTRY from the entry type list then MEETING from the select a code list.

and meetings only show for the selected date
« Last Edit: October 05, 2019, 10:34:51 am by Michael »

Offline Michael

  • Administrator
  • Sr. Member
  • *****
  • Posts: 339
  • Karma: +2/-0
  • Gender: Male
  • Db Dreams Owner
  • Location: Margate, Kent, UK
  • Referrals: 8
In Mod Calendar1

Replace This API Calls For Those below

Code: [Select]
#If VBA7 Then 'use PtrSafe & LongPtr
Declare PtrSafe Sub GetWindowRect Lib "user32" (ByVal hWnd As LongPtr, lpRect As FormCoords)
Declare PtrSafe Function GetDC Lib "user32" (ByVal hWnd As LongPtr) As Long
Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal hWnd As LongPtr, ByVal hDC As LongPtr) As Long
Declare PtrSafe Function GetDeviceCaps Lib "gdi32" (ByVal hDC As LongPtr, ByVal nIndex As Long) As Long
Declare PtrSafe Function apiSystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, _
                    ByVal uParam As Long, lpvParam As RECT, ByVal fuWinIni As Long) As Long
#Else
'API Declarations
Declare Sub GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As FormCoords)
Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As Long) As Long
Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long

Declare Function apiSystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, lpvParam As RECT, ByVal fuWinIni As Long) As Long

#End If

Open ModColorPicker And replace This

Code: [Select]
Private Type COLORSTRUC
  lStructSize As Long
  hWnd As Long
  hInstance As Long
  rgbResult As Long
  lpCustColors As String
  Flags As Long
  lCustData As Long
  lpfnHook As Long
  lpTemplateName As String
End Type

Private Const CC_SOLIDCOLOR = &H80
Private Const CC_OPENALL = &H2
Private Const CC_RGBINIT = &H1

#If VBA7 Then 'use PtrSafe & LongPtr
    Private Declare PtrSafe Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As COLORSTRUC) As Long
#Else
    Private Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As COLORSTRUC) As Long
#End If

With This
Code: [Select]
Private Const CC_SOLIDCOLOR = &H80
Private Const CC_OPENALL = &H2
Private Const CC_RGBINIT = &H1

#If VBA7 Then 'use PtrSafe & LongPtr

Private Type COLORSTRUC
  lStructSize As Long
  hWnd As LongPtr
  hInstance As LongPtr
  rgbResult As Long
  lpCustColors As String
  Flags As Long
  lCustData As LongPtr
  lpfnHook As LongPtr
  lpTemplateName As String
End Type

    Private Declare PtrSafe Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As COLORSTRUC) As Long
   
#Else

Private Type COLORSTRUC
  lStructSize As Long
  hWnd As Long
  hInstance As Long
  rgbResult As Long
  lpCustColors As String
  Flags As Long
  lCustData As Long
  lpfnHook As Long
  lpTemplateName As String
End Type

    Private Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As COLORSTRUC) As Long
#End If

« Last Edit: December 29, 2019, 10:17:08 am by Michael »

 

Downloads

Free To Use Programs

Chart Tracker Elite 2020

Works Manager

Contact Manager

Simple Home Accounts

Book Library

Picture Library

 

Under Development

Charitable Contributions

 

Developer Tools

Project Manager

Style Manager

 

Open Code Templates

Master Template

Task Management

 

Open Code Examples

Employee Example V4

Small Examples

 

Recent Topics

Charitable Contributions project Status by Michael
Today at 05:46:07 pm

Charitable Contributions User Manual by Michael
March 30, 2020, 10:42:10 am

Task management errors and corrections by Michael
March 29, 2020, 08:56:53 pm

Project Manager LICENSE AGREEMENT required before access is given by J19ull
March 29, 2020, 06:54:06 pm

Project Manager Screenshots by Michael
March 29, 2020, 09:40:28 am

Toyah Willcox Analysis 20 march 2020 by Michael
March 28, 2020, 12:36:48 pm

UK Singles/Albums Charts 01 Mar 2020 to 07 Mar 2020 Analysis by borobutch
March 28, 2020, 10:30:45 am