reclusivemonkey
Registered User.
- Local time
- Today, 19:29
- Joined
- Oct 5, 2004
- Messages
- 749
Hello Everyone,
I've created a custom function to get a value for a query which feeds a DAP. The function is as follows (in a Standard Module, not a Class Module);
When the query is run from Access with IntDepDate(0), no problems. I can change the zero in the query and get the results I expect. I have created a DAP page from this query, and clicking on the page view gives me the report with all the data. However, when I look at the page via IE, I get the "Data provider failed while executing a provider command." then "Undefined function 'IntDepDate' in expression. The location of the DAP is S:\Reports\Interdepartmentals.htm, but network drive's UNC is \\scsd\teams\Finance\Reports\Interdepartmentals.htm so I changed it to this in the properties as is advised. I've also tried the full UNC in the address bar of IE. It finds the htm page but still gives the same error message. I also tried leaving it as just Interdepartmentals.htm (the .mdb is in the same location) but no difference. I've googled around and looked on here, but I can't find anyone with the same problem, all references to 'Undefined expression" are to do with the built in expression. Anyone have a clue what I've missed? Or is it a case of making the DAP again?
I've created a custom function to get a value for a query which feeds a DAP. The function is as follows (in a Standard Module, not a Class Module);
Code:
Public Function IntDepDate(ByVal MinusDays As Integer) As Date
' Get the date for the interdepartmentals
' This is normally yesterday, except on Mondays when its Friday!
' For ease of use, a value of days to minus must be added.
' Normally we use IntDepDate(0) but this can be increased to get any date
Dim myDate As Date
myDate = Date
If Weekday(myDate) = 2 Then
IntDepDate = myDate - 3
Else
IntDepDate = myDate - 1
End If
IntDepDate = IntDepDate - MinusDays
' Print in Immediate window for degbugging
Debug.Print IntDepDate
End Function
When the query is run from Access with IntDepDate(0), no problems. I can change the zero in the query and get the results I expect. I have created a DAP page from this query, and clicking on the page view gives me the report with all the data. However, when I look at the page via IE, I get the "Data provider failed while executing a provider command." then "Undefined function 'IntDepDate' in expression. The location of the DAP is S:\Reports\Interdepartmentals.htm, but network drive's UNC is \\scsd\teams\Finance\Reports\Interdepartmentals.htm so I changed it to this in the properties as is advised. I've also tried the full UNC in the address bar of IE. It finds the htm page but still gives the same error message. I also tried leaving it as just Interdepartmentals.htm (the .mdb is in the same location) but no difference. I've googled around and looked on here, but I can't find anyone with the same problem, all references to 'Undefined expression" are to do with the built in expression. Anyone have a clue what I've missed? Or is it a case of making the DAP again?
Last edited: