Svar: RE: [AccessD] Weird query question

Gustav Brock Gustav at
Mon Jan 3 09:24:39 CST 2005

Hi Bobby

You have in the SQL one or more references to a form like:

.. =[Forms].[frmSomeForm].[txtSomeTextbox]

These are not understood when opening the query from code.
One method is to open it like this:

  Dim prm As Parameter
  Set qdf=dbs.QueryDefs("qdyYourQuery")
  For Each prm in qdf.Parameters
    prm.Value = Eval(prm.Name)
  Set rst = qdf.OpenRecordset()


-----Original Message-----
From: Bobby Heid [mailto:bheid at] 
Sent: Monday, January 03, 2005 8:41 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Weird query question

Hey all,

I was modifying a query that a co-worker wrote so that it links with a
different sub query than the one it started with.  The query is a SQL
executed with a openrecordset command.

The problem is that if I am getting the classic "Too few
error message.  If I take the text and put it into a query and save it,
can run the query fine.  When I try to run that query with the
function using a querydef, I still get the error message.

More information about the AccessD mailing list