Kath Pelletti
KP at sdsonline.net
Tue Oct 12 22:28:42 CDT 2004
Yes - there is a form parameter in the query so I'll have to think over that logic then as the query is used by multiple processes... The static function sounds a good solution. Kath ----- Original Message ----- From: Stuart McLachlan To: Access Developers discussion and problemsolving Sent: Wednesday, October 13, 2004 1:00 PM Subject: Re: [AccessD] Help with syntax please....OpenRecordset 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 -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com