Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default 3601 Too Few parameters Expected 1

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?



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default 3601 Too Few parameters Expected 1

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


On Oct 30, 4:23 pm, Phil Smith wrote:
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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the Expected Value of a PDF backformystuff Excel Worksheet Functions 1 February 1st 07 06:54 AM
Lookup returning one more than expected Victor Excel Worksheet Functions 3 November 23rd 06 11:40 PM
Not sorting as expected Robbie New Users to Excel 4 August 15th 06 02:27 AM
Expected end of Statement FIRSTROUNDKO via OfficeKB.com Excel Worksheet Functions 2 April 11th 06 11:59 AM
COUNTIF does not return the value as I expected ciccia Excel Discussion (Misc queries) 6 July 19th 05 05:12 AM


All times are GMT +1. The time now is 09:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"