473,320 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Recordset Error

Hi and TIA! I have a query that uses 2 values from my form as criteria for
2 fields in the query. I can select the options and open the query. I can
base a form on the query and launch it from my criteria form with no
problem. However if I try to open a recordset object against the query from
this same criteria form I receive the (error # 3061 Too few parameters.
expected 2.). I've tried first opening the query from code, which worked
fine, then building my recordset, but received the same error. Any help is
appreciated.

Set db = CurrentDb()
Set rst1 = db.OpenRecordset("select * From [qryMyQry]")

--
Reggie

"Half this game is 90% mental."

----------
Nov 12 '05 #1
2 4405
On Sun, 28 Sep 2003 00:10:28 -0600 in comp.databases.ms-access,
"Reggie" <newsgroups@no_spam.comcast.net> wrote:
Hi and TIA! I have a query that uses 2 values from my form as criteria for
2 fields in the query. I can select the options and open the query. I can
base a form on the query and launch it from my criteria form with no
problem. However if I try to open a recordset object against the query from
this same criteria form I receive the (error # 3061 Too few parameters.
expected 2.). I've tried first opening the query from code, which worked
fine, then building my recordset, but received the same error. Any help is
appreciated.

Set db = CurrentDb()
Set rst1 = db.OpenRecordset("select * From [qryMyQry]")


In DAO you have to open the query and set the parameters, e.g.

Set qdf = db.QueryDefs("qryMyQry")
qdf.parameters("nameofparameter1")=valueofparamete r1
qdf.parameters("nameofparameter2")=valueofparamete r2
set rst1=qdf.OpenRecordset()
....
--
A)bort, R)etry, I)nfluence with large hammer.
Nov 12 '05 #2
I see said the blind man. Thanks Trevor!

--
Reggie

"Half this game is 90% mental."

----------
"Trevor Best" <bouncer@localhost> wrote in message
news:i8********************************@4ax.com...
On Sun, 28 Sep 2003 00:10:28 -0600 in comp.databases.ms-access,
"Reggie" <newsgroups@no_spam.comcast.net> wrote:
Hi and TIA! I have a query that uses 2 values from my form as criteria for2 fields in the query. I can select the options and open the query. I canbase a form on the query and launch it from my criteria form with no
problem. However if I try to open a recordset object against the query fromthis same criteria form I receive the (error # 3061 Too few parameters.
expected 2.). I've tried first opening the query from code, which worked
fine, then building my recordset, but received the same error. Any help isappreciated.

Set db = CurrentDb()
Set rst1 = db.OpenRecordset("select * From [qryMyQry]")


In DAO you have to open the query and set the parameters, e.g.

Set qdf = db.QueryDefs("qryMyQry")
qdf.parameters("nameofparameter1")=valueofparamete r1
qdf.parameters("nameofparameter2")=valueofparamete r2
set rst1=qdf.OpenRecordset()
...
--
A)bort, R)etry, I)nfluence with large hammer.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: David Berry | last post by:
I'm trying to use a recordset inside of a function but I'm getting an "object required 'adoRS" error. At the top of the page I create my recordset, ex: dim strConnection, adoCN, adoRS, strSQL...
8
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be...
6
by: Alan Silver | last post by:
Hello, I have an ASP that takes a connection string and SQL statement in the querystring and is supposed to return the XML representation of the recordset to the Response stream (don't worry,...
5
by: Simone | last post by:
Hello I hope you guys can help me. I am very new to ADO... I am creating a ADODB connection in a module and trying to access it from a command button in a form. Function fxEIDAssgn(plngEID As...
4
by: Gerry Abbott | last post by:
Hi all. I wish to call a recordset from a function. Ive tried the following approach, -------------------------------------------------------- Function PassRS() As Recordset Dim db As...
2
by: ano1optimist | last post by:
I have a form with a search button. I'm using command parameters to pass search criteria to a stored procedure. Here is my code: Stored procedure: CREATE PROCEDURE . @strCriteria varchar(200)...
3
by: Nathan Bloomfield | last post by:
Hi there, I am having difficulty with a piece of code which would work wonders for my application if only the error trapping worked properly. Basically, it works as follows: - adds records...
7
by: marmottedodue | last post by:
Hello, I'm trying to debug an access project in which two kind of recordset are used: ADODB.recordset and DAO.recordset. I'm trying to set the whole project on DAO.recordset, but the following...
2
by: technocraze | last post by:
Hi guys, I have encountered this error when updating the values to the MS Acess table. Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.