Hello all, I have a function that I am trying to write to sum a field in a table and pass that number to a form (Call the function from the form)
My function looks like this:
Function GetDays(StartDate, EndDate As Date)
Dim strSQL As String
strSQL = "SELECT SUM(BR_DT.[#ofWorkDays]) AS [Days]FROM BR_DT Where (((BR_DT.[BR Date]) Between #" & [StartDate] & "# And #" & [EndDate] & "#))"
End Function
StartDate and EndDate I pass into the function from the form.
I placed a text box on the form and this is what I used.
=GetDays(StartDate, EndDate)
All that comes back is blank.
What am I doing wrong?
Any help is appreciated!
Chris
My function looks like this:
Function GetDays(StartDate, EndDate As Date)
Dim strSQL As String
strSQL = "SELECT SUM(BR_DT.[#ofWorkDays]) AS [Days]FROM BR_DT Where (((BR_DT.[BR Date]) Between #" & [StartDate] & "# And #" & [EndDate] & "#))"
End Function
StartDate and EndDate I pass into the function from the form.
I placed a text box on the form and this is what I used.
=GetDays(StartDate, EndDate)
All that comes back is blank.
What am I doing wrong?
Any help is appreciated!
Chris