[AccessD] Referencing Recordsource in Report

Charlotte Foust cfoust at infostatsystems.com
Tue Sep 16 11:22:08 CDT 2003


When you run a query in code, you have to instantiate and pass the
parameters explicitly.  You can't rely on it picking up form references
because it won't.

Charlotte Foust

-----Original Message-----
From: Tim Thiessen [mailto:tim at irwin-greenhouses.com] 
Sent: Tuesday, September 16, 2003 8:05 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Referencing Recordsource in Report


Hi Gustav,
I tried that and it returns an error message "Error 3061 Too few
parameters Expected 3".  The underlying query does rely on a subquery
which does have 3 parameters but the parameters are supplied by an open
form and runs just fine until I reference it it code.  Any thoughts on
why and how to fix? Tim



Hi Tim

Ahh, that is right - not until Access XP (?) I believe.

How about

  Set rst = CurDb.OpenRecordset(Me.RecordSource)

/gustav


> Gustav,

> Thanks your help.  Evidently, RecordsetClone is not a property of 
> reports, only forms.  Any other suggestions? Tim

>

_______________________________________________
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