Hi,
On Fri, 19 Dec 2003 19:02:26 GMT, MX1 wrote:
I have a query that gets a few values from a form. The problem I'm having
is a date field in the query. When I put the value in the criteria, it
works fine. When I put the same value as an item in a combo box of the form
and try to pass the value, I get "This expression is typed incorrectly or
too complicated to be evaluated".
Here it is:
'6/30/' & Str(Year(Now()))
The options in the row source of the combo box are as follows:
"January";"'6/30/' & str(year(now)))";"July";"12/31/' & str(year(now)))"
Is my formatting incorrect? I get the same thing when trying to pass "0 or
1" to denote both yes and no values of a checkbox. It doesn't like the word
OR. Any thoughts would be GREATLY appreciated as always. Thanks!
two things: when working with dates, assure they're converted right. When
using expressions that are being "pulled" from a query, use the
eval-function around your expression there.
I.e. in your query, it should work with your value-list like this:
SELECT eval("cdate(forms!YourForm!YourCombo!column(1))") AS something, ...
The above will require a valid date though - you'll either have to assure
that from the form (which it would be with the string you create) or from
within the query with i.e. nz (slowing down the process).
Cheers,
Olaf [MVP]
--
My .02:
www.Resources.IntuiDev.com