| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
|||
|
|||
|
Error opening query recordset that references control object
I have a several saved queries that are hierarchically dependent. In one of my forms I need to access one of the queries.
Set rs = db.OpenRecordset("qryCTI_Unbilled") But I get an error: Run-time error '3601': Too few parameters. Expected 2. The strange thing about this is, if I open the query directly, it has all the information I need, and I get no errors. What seems to be causing the problem is in the WHERE clause where I reference a textbox from the form. ...WHERE (((ars5_budgets1.DATE_FROM)<=[Forms]![frmCTI]![txtBillDateEnd]) ... This is referenced in the a query at the base of the nested structure. Is this doable? Based on the debug, I am thinking that in runtime mode, the query is not able to pick up these control object values to process the query, because in debug mode, when the error pops up, I get no records when I open the query. I guess an alternative would be to write the entire SQL statement as a string and assign the object values to VBA variable. Doing this at runtime may effect performance because of the complexity, but at least that's a solution. Any alternative solution is appreciated, thanks! Last edited by dungstar; 05-05-2003 at 10:08 AM.. |
| Sponsored Links |
|
#2
|
||||
|
||||
|
Hi - check out this MS Knowledge Base article #209203 - should solve your problem:
http://support.microsoft.com/default...b;en-us;209203 HTH E |
|
#3
|
|||
|
|||
|
Thanks a bunch Elana, fellow Seattlite!
|
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|