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

Darren DICK d.dick at uws.edu.au
Tue Oct 12 22:44:36 CDT 2004


Hey Andrew
I'm back from leave
So...when's a good time to meet??

Talk soon

Denz
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Wednesday, 13 October 2004 1:00 PM
To: Access Developers discussion and problemsolving
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




More information about the AccessD mailing list