3061 Error when doing everything that works in another module.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I reference the proper DAO Library.
I included Dim rs as DAO.RecorSet.
I created the SQL in native Access.
The Query works in native Access.

The command lines are:

selector = SELECT Vendor.V_Name FROM Vendor WHERE (((Vendor.[V_ ID])=39));

Set rs = CurrentDb.OpenRecordset(selector)

I am still receiving a 3061 error. What am I doing wrong? If nothing is
wrong with the code, how do I fix this?

Thanks in advance.
 
3061 error, meaning "too few parameters...", right?

I assume that the SQL statement is a properly delimited text string in your
code:
selector = "SELECT Vendor.V_Name FROM Vendor WHERE (((Vendor.[V_
ID])=39));"

You mention "native ACCESS".... is this a reference to using the design view
of a query to create the SQL statement and to run the query? It works there,
but not in your code? What is the exact error message that you're getting?
 
Ken:

Error message states that 1 parameter is expected. The statement was cut
from the SQL view of Queries (after creating the query in the design view and
testing by looking at the worksheet view) and placed withing the quotation
marks as shown in the original message.

The field, V_ID is an auto number field.

Thanks!

Ken Snell said:
3061 error, meaning "too few parameters...", right?

I assume that the SQL statement is a properly delimited text string in your
code:
selector = "SELECT Vendor.V_Name FROM Vendor WHERE (((Vendor.[V_
ID])=39));"

You mention "native ACCESS".... is this a reference to using the design view
of a query to create the SQL statement and to run the query? It works there,
but not in your code? What is the exact error message that you're getting?

--

Ken Snell
<MS ACCESS MVP>



Andy Dorph said:
I reference the proper DAO Library.
I included Dim rs as DAO.RecorSet.
I created the SQL in native Access.
The Query works in native Access.

The command lines are:

selector = SELECT Vendor.V_Name FROM Vendor WHERE (((Vendor.[V_ ID])=39));

Set rs = CurrentDb.OpenRecordset(selector)

I am still receiving a 3061 error. What am I doing wrong? If nothing is
wrong with the code, how do I fix this?

Thanks in advance.
 
Sounds then as if one of the field names is not exactly the same as what is
in the table itself. I know that this seems impossible, seeing as how you
built the SQL string in the query designer. But, post the actual names of
the fields in the Vendor table and let's see what's there.

--

Ken Snell
<MS ACCESS MVP>



Andy Dorph said:
Ken:

Error message states that 1 parameter is expected. The statement was cut
from the SQL view of Queries (after creating the query in the design view
and
testing by looking at the worksheet view) and placed withing the quotation
marks as shown in the original message.

The field, V_ID is an auto number field.

Thanks!

Ken Snell said:
3061 error, meaning "too few parameters...", right?

I assume that the SQL statement is a properly delimited text string in
your
code:
selector = "SELECT Vendor.V_Name FROM Vendor WHERE (((Vendor.[V_
ID])=39));"

You mention "native ACCESS".... is this a reference to using the design
view
of a query to create the SQL statement and to run the query? It works
there,
but not in your code? What is the exact error message that you're
getting?

--

Ken Snell
<MS ACCESS MVP>



Andy Dorph said:
I reference the proper DAO Library.
I included Dim rs as DAO.RecorSet.
I created the SQL in native Access.
The Query works in native Access.

The command lines are:

selector = SELECT Vendor.V_Name FROM Vendor WHERE (((Vendor.[V_
ID])=39));

Set rs = CurrentDb.OpenRecordset(selector)

I am still receiving a 3061 error. What am I doing wrong? If nothing
is
wrong with the code, how do I fix this?

Thanks in advance.
 
Back
Top