
DAO Error 3265 - technical - help!
ACC97: I have an insert (append) query that uses an extremely simple
user-defined function to plug a value into a column based on a global
variable. The query takes two named parameters, defined and data-typed
explicitly. When I just execute the query it runs just fine.
I also have a fairly complex function that causes the same append query to
iterate a varying number of times with varying parameter values. The
iteration all happens within a transaction to preclude partial updates.
The problem is that sometimes the complex function triggers the DAO 3265
error, "Undefined function 'MyFunction' in expression.", where MyFunction is
the name of the simple function referenced in the first line of this post.
Other times it works just fine. I cannot detect a pattern.
Here are the clues I have:
1) The error is triggered the first time the complex function references the
Parameters collection of the QueryDef object that represents the append
query:
qdf.Parameters("FarOutPeriod").Value = strFarOutPeriod
2) When I inspect the parameters collection of the instantiated QueryDef in
the debug window, expanding the tree view for the QueryDef object, I see
that there is only one property - Count - referenced for the Parameters
collection, and that the value for THAT, for some strange reason, is where
the DAO error is living. Is that bizarre, or what?
This is a screen capture from the debug window:
Expression : Value : Type
- : Parameters : : Parameters/Parameters
: Count : <Undefined function 'GetSpan' in expression.> : Integer
3) The function either works or it doesn't. I.e., the error does not seem to
be dependent on the particular data being processed by the function at any
given moment.
Does anyone have any ideas about this???
Thanks in advance!
- Tony
Tony Scilipoti
****************
Applications Development Lead
Brigham Surgical Group
Brookline, Massachusetts USA