Working Days Sample Database

Colin, is there a way to bring this result into the a form?

attachment.php
 

Attachments

  • Capture2.PNG
    Capture2.PNG
    9.4 KB · Views: 298
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
 
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

attachment.php
 

Attachments

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

Users who are viewing this thread

Back
Top Bottom