yes, that works if all the parameters are of the form
[Forms].[x].[y]
and all the forms are open.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Lars Brownie said:
Lindypops,
In a different case I ran into this error as well yesterday, when I tried
to point a recordset to a query. This was a special query with criteria
references to several form's fields (including a field that could also be
null). The query ran fine as a saved query. However, running the saved
query from code or from a query string resulted in the error. I found the
following code that made it work. Maybe it can be of use to you. If
someone can explain why the query doesn't run from code normally, keep me
posted.
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rs As DAO.Recordset
Dim parm As DAO.Parameter
Set db = CurrentDb
Set qdf = db.QueryDefs("qryMyQuery")
For Each parm In qdf.Parameters
parm.Value = Eval(parm.Name)
Next parm
Set rs = qdf.OpenRecordset
....
Lars