R
roger
MSA2k7: An existing select query and an existing sub that all work fine
I add one more column to my select query to filter the records further. It
uses a "like" function that pulls a value from an unbound combo box on a form:
Like "*" & [Forms]![frmGroups].[cboFilterCrit] & "*"
The query works. It opens from the db container, and from a docmd.openquery
command:
But:
Now my existing sub crashes when I set an object to the query :
Set objSourceQry = CurrentDb.OpenRecordset(strSourceQry) ' - this line
crashes
with "Too few parameters expected 1"
but if i substitute that with:
DoCmd.OpenQuery strSourceQry ' -- it works
If I try to open the query while the Code is in Break mode, I get:
"This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables"
It I stop the code and open the query, it works.
If I delete the "like" statement, then Set object works.
what gives?
please don't refrain from answering just because you don't "know" the
answer, anyone with any ideas, please chime in.
(i've already repaired the db, next I'm going to reboot the machine, just to
be sure, and then I'm checking for Office Updates)
*A*HA tia
I add one more column to my select query to filter the records further. It
uses a "like" function that pulls a value from an unbound combo box on a form:
Like "*" & [Forms]![frmGroups].[cboFilterCrit] & "*"
The query works. It opens from the db container, and from a docmd.openquery
command:
But:
Now my existing sub crashes when I set an object to the query :
Set objSourceQry = CurrentDb.OpenRecordset(strSourceQry) ' - this line
crashes
with "Too few parameters expected 1"
but if i substitute that with:
DoCmd.OpenQuery strSourceQry ' -- it works
If I try to open the query while the Code is in Break mode, I get:
"This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables"
It I stop the code and open the query, it works.
If I delete the "like" statement, then Set object works.
what gives?
please don't refrain from answering just because you don't "know" the
answer, anyone with any ideas, please chime in.
(i've already repaired the db, next I'm going to reboot the machine, just to
be sure, and then I'm checking for Office Updates)
*A*HA tia