K
kiln
I'm really having some strange problems with an Access 2000 sp3 db; a db
I'd regard as being fairly simply by my standards. I have long exp with
Access; I've never seen any behaviors like what I'm about to report,
that I can remember.
Basically, queries in this db, or some queries, have a hard time
referencing controls on forms for param values, or getting the values
from workarounds like functions referencing global arrays. The problem
is much more general than I first expected.
For instance, here is a test sql string from a saved query:
SELECT tblContact.ContID, [forms]![frmMap]![txtAxisX] AS x, [forms]!
[frmMap]![txtAxisY] AS y, [forms]![frmOrganization]![cboOrgID] AS xorg,
[forms]![frmContact]![cboContID] AS xcont
FROM tblContact;
(The ref to tblContact is only there to get some rows to show up, it's
not used; trust me it can be ignored, all queries that utilize the refs
fail, this is for example only.)
With the sql above, with the two forms open to records, both refs to the
combos return a (square) character. If I wrap the form refs with clng
() or cstr(), I get the expected long value (1, 2, etc). I've never ever
seen such behavior, the combos are unbound, completely typical of
hundreds of such nav combos I've implemented. That's one oddity.
In the two other form ref cases, xorg and xcont, "normally" the expected
plain text values are returned. However, during a major code routine, I
call a query that refs these form controls, the params values returned
by the form refs are empty (and I get a 3061 Too few parameters,
expected 2). Immediately before or after the code routine the query
works fine. What I'm trying is routine, so I thought, "one of these
quirky problems that will never be understood" and devised what I
thought would be a fine workaround - well in advance of the code routine
I populate a global array with the values the query will need, then made
a function that returns the array values to the query for use as params.
But amazingly this fails with the ever useless "expression typed
incorrectly or is too complex". The function that returns the array
values is never run (or at lease pointer never arrives at a breakpoint
in the function). I can call the function in the immediate window and it
returns values as expected. Yes, it's typed correctly.
So, this is really bizzare and deadly behavior. What I've tried to
workaround besides the above:
-fully qualified the query param calls
-repaired and compacted
-decompiled
-imported all to a new db
-tried on a other pc with same patch level of Access (which is the
latest)
I hope someone else has seen these problems, which while different seem
to be related, and has a fix, thanks.
I'd regard as being fairly simply by my standards. I have long exp with
Access; I've never seen any behaviors like what I'm about to report,
that I can remember.
Basically, queries in this db, or some queries, have a hard time
referencing controls on forms for param values, or getting the values
from workarounds like functions referencing global arrays. The problem
is much more general than I first expected.
For instance, here is a test sql string from a saved query:
SELECT tblContact.ContID, [forms]![frmMap]![txtAxisX] AS x, [forms]!
[frmMap]![txtAxisY] AS y, [forms]![frmOrganization]![cboOrgID] AS xorg,
[forms]![frmContact]![cboContID] AS xcont
FROM tblContact;
(The ref to tblContact is only there to get some rows to show up, it's
not used; trust me it can be ignored, all queries that utilize the refs
fail, this is for example only.)
With the sql above, with the two forms open to records, both refs to the
combos return a (square) character. If I wrap the form refs with clng
() or cstr(), I get the expected long value (1, 2, etc). I've never ever
seen such behavior, the combos are unbound, completely typical of
hundreds of such nav combos I've implemented. That's one oddity.
In the two other form ref cases, xorg and xcont, "normally" the expected
plain text values are returned. However, during a major code routine, I
call a query that refs these form controls, the params values returned
by the form refs are empty (and I get a 3061 Too few parameters,
expected 2). Immediately before or after the code routine the query
works fine. What I'm trying is routine, so I thought, "one of these
quirky problems that will never be understood" and devised what I
thought would be a fine workaround - well in advance of the code routine
I populate a global array with the values the query will need, then made
a function that returns the array values to the query for use as params.
But amazingly this fails with the ever useless "expression typed
incorrectly or is too complex". The function that returns the array
values is never run (or at lease pointer never arrives at a breakpoint
in the function). I can call the function in the immediate window and it
returns values as expected. Yes, it's typed correctly.
So, this is really bizzare and deadly behavior. What I've tried to
workaround besides the above:
-fully qualified the query param calls
-repaired and compacted
-decompiled
-imported all to a new db
-tried on a other pc with same patch level of Access (which is the
latest)
I hope someone else has seen these problems, which while different seem
to be related, and has a fix, thanks.