Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to find the Expected Value of a PDF | Excel Worksheet Functions | |||
Lookup returning one more than expected | Excel Worksheet Functions | |||
Not sorting as expected | New Users to Excel | |||
Expected end of Statement | Excel Worksheet Functions | |||
COUNTIF does not return the value as I expected | Excel Discussion (Misc queries) |