[AccessD] Help with syntax please....OpenRecordset

Stuart McLachlan stuart at lexacorp.com.pg
Tue Oct 12 22:00:23 CDT 2004


On 13 Oct 2004 at 11:46, Kath Pelletti wrote:

> I am trying to use a saved query for my recordset source....but keep getting an error 'Too few parameters - expected 1' on the line 'Set rs = '
> After many hours, I can't fix it so would appreciate the help.....
> 

The problem is in the query "QryWebLetter_ReadRecipientsEmai". You are 
probably using a reference a control on a form as a criterion/paramter for 
your query. You can't do that when you call the query as a recordset.

My usual workaround is to create a Static function called StoredValue() to 
store the parameter, change the criterion in the query to "=StoredValue()" 
and set the value of the function before calling the query  with 
"retval = StoredValue(Forms!myForm.myControl)" or just
"StoredValue Forms!myForm.myControl"








-- 
Stuart





More information about the AccessD mailing list