Working Days Sample Database (1 Viewer)

thedeadzeds

Registered User.
Local time
Today, 14:26
Joined
Jan 8, 2014
Messages
40
Colin, is there a way to bring this result into the a form?

 

Attachments

  • Capture2.PNG
    Capture2.PNG
    9.4 KB · Views: 235

isladogs

MVP / VIP
Local time
Today, 21:26
Joined
Jan 14, 2017
Messages
18,186
Assuming you are using the GetDaysLeave function I provided, it had this syntax: GetDaysLeave(StartDate, EndDate)


So set the record source for the textbox to

Code:
=GetDaysLeave(Me.txtStartDate, Me.txtEndDate)

where the 2 textboxes are the first & last dates of the holiday request on the form
 

thedeadzeds

Registered User.
Local time
Today, 14:26
Joined
Jan 8, 2014
Messages
40
Thank you Colin, I am getting an error message as per below. So sorry i know this is something i'm doing rather than your instructions. Database attached

 

Attachments

  • Capture3.PNG
    Capture3.PNG
    7.8 KB · Views: 206
  • Colin Test v2.accdb
    644 KB · Views: 83

isladogs

MVP / VIP
Local time
Today, 21:26
Joined
Jan 14, 2017
Messages
18,186
Sorry I missed this post until now. You may already have fixed it but in case not I've attached a corrected version

Your problem was trying to use Me.txtDateFrom & Me.txtDateTo in the function which creates an error.

Instead of using the table & then running the function, use one of the 2 queries provided as the form record source.
1. frmExampleDCount based on qryExampleDCount - gives result as a text value
2. frmExampleFunction based on qryExampleFunction - result is a number

Personally, I would use the second one
 

Attachments

  • Colin Test v3.zip
    39 KB · Views: 98

Users who are viewing this thread

Top Bottom