Re: How to OpenRecordset(queryName refering to form)
- From: Nikos Yannacopoulos <nyannacoREMOVETHISBIT@xxxxx>
- Date: Tue, 11 Apr 2006 11:38:59 +0300
Though you are not painting the whole picture here, I suspect the problem is in the creation of the strSQL string, wherever you do that (the code that calls the function).
That code, should pass on to the function the *current values* of the form controls in the strSQL string, instead of references to the form controls, which I suspect is what you are trying to do.
Please post that part of your code, so I (or someone else) can provide more specific feedback. To that end, it will also help if you specify the data type of the fields to which each referenced control is bound (i.e. text vs. numeric vs. date etc).
HTH,
Nikos
Fjordur wrote:
Hi,.
I have the following code
Public Function f(strSql As String, ...
...
r= CurrentDb.OpenRecordset(strSql)
I call f with the name of queries as arguments.
Calling function f with the name of a query works only when the query
doesn't include a where clause referring to an open form
([table].field=[Forms]![form]![control]).
Is there a way I can refer to the form in the query, so that I can use my
function f with only the name of the query as an argument? BTW some of the
queries have such a where clause, others don't.
This is rather crucial to the project, and I hope there's a way I can
circumvent this (hopefully a shortcoming of mine regarding SQL-VB syntax)
Thanx, all
- Follow-Ups:
- Re: How to OpenRecordset(queryName refering to form)
- From: Fjordur
- Re: How to OpenRecordset(queryName refering to form)
- References:
- How to OpenRecordset(queryName refering to form)
- From: Fjordur
- How to OpenRecordset(queryName refering to form)
- Prev by Date: Re: Transforming empty fields into "0" in a query
- Next by Date: Re: How to OpenRecordset(queryName refering to form)
- Previous by thread: How to OpenRecordset(queryName refering to form)
- Next by thread: Re: How to OpenRecordset(queryName refering to form)
- Index(es):
Relevant Pages
|