3601 Too Few parameters Expected 1

P

Phil Smith

The function itself works, tested with other calls.

The call which fails is:
Colors: Concatenate("SELECT [Sizes for Items on Selected Prebook].[Size]
FROM [Sizes for Items on Selected Prebook] WHERE [Sizes for Items on
Selected Prebook].[old_sku]= """ & [Prebook Item Verify Step 1]!old_sku
& """ AND [Sizes for Items on Selected Prebook].[Color]=""" & [Prebook
Item Verify Step 1]!Color & """;")

It fails at this line in the code:

Set rs = db.OpenRecordset(pstrSQL)

At this point, pstrSQL is the parameter passed above, which resolves to
(as shown in immeditate mode)

SELECT [Sizes for Items on Selected Prebook].[Size] FROM [Sizes for
Items on Selected Prebook] WHERE [Sizes for Items on Selected
Prebook].[old_sku]= "44441129" AND [Sizes for Items on Selected
Prebook].[Color]="Black";

That string, put into it's own SQL query, properly returns 2 records.

So, the function itself works, the parameter I am passing resolves as it
should, and what it resolves to works just fine as an SQL query.

However, when that perfectly functional string is passed to

Set rs = db.OpenRecordset(pstrSQL)

It fails with 3601. Any ideas why?
 
J

JP

Hello,

That looks like Access code, are you sure you are in the right place?
There is a ng for Access it's microsoft.public.access.modulesdaovba.


HTH,
JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top