Argument from form does not work in Query

hgus393

Registered User.
Local time
Today, 08:15
Joined
Jan 27, 2009
Messages
83
Hi all,

I am running a query with data from a form. The conditions that I am using is date, > argument (greater than) and a numerical value. Ok running only the date and the numerical values works dandy. But when I add the > argument to the same column condition as the numerical values, it returns nothing. BUT if I dont take the value (>) from the form but write i manually the query returns what I want. The Criteria field looks like this when it doesn't work [Forms]![Conditions]![Argument]&[Forms]![Conditions]![Value], but if i write > [Forms]![Conditions]![Value] it works. Please what am I doing wrong?? :confused:

Cheers

Rob
 
[Forms]![Conditions]![Argument]&[Forms]![Conditions]![Value]

The problem is mostly to do with the concatenation. Are you sure you don't want to add (+) them?

> Val([Forms]![Conditions]![Argument]&[Forms]![Conditions]![Value])

should work.
 
[Forms]![Conditions]![Argument]&[Forms]![Conditions]![Value]

The problem is mostly to do with the concatenation. Are you sure you don't want to add (+) them?

> Val([Forms]![Conditions]![Argument]&[Forms]![Conditions]![Value])

should work.

Hum the problem is that I am trying to incorporate a (>) sign in the criteria field together with the value. For ex. I am trying to do this:
>365 Both values come from a form. Doing the above yields nothing I am afraid.
Cheers
Rob
 
>365 Both values come from a form. Doing the above yields nothing I am afraid.
This doesn't mean much Rob.

So let's break it down (to yield 365).

[Forms]![Conditions]![Argument] = ???
[Forms]![Conditions]![Value] = ???

By the way, Value is an Access reserved keyword and should not be used.
 
You can't do it this way. There was a way posted on Microsoft Answers about using EVAL to do it. Not sure about the whole syntax for that one though. It might be

Eval([Forms]![Conditions]![Argument] & [Forms]![Conditions]![Value])

But I don't know. I find that for these things using code to take care of the SQL works for me. So I either use a QDF with the SQL and change the SQL or I just build the query in code and use it that way.
 
There's nothing wrong in doing it that way. It's just a simple concatenation and cast. If you were referring to a property that needed a parens (such as Column()), then you need Eval() in a query. The OP didn't express there was an error with syntax.

The Eval() equivalent is:

> Eval("[Forms]![Conditions]![Argument] & [Forms]![Conditions]![Value]")
 
There's nothing wrong in doing it that way. It's just a simple concatenation and cast. If you were referring to a property that needed a parens (such as Column()), then you need Eval() in a query. The OP didn't express there was an error with syntax.

The Eval() equivalent is:

> Eval("[Forms]![Conditions]![Argument] & [Forms]![Conditions]![Value]")

I think there's a communication error here. The ARGUMENT they are talking about, unless I misread it, is the greater than symbol. So, they are wanting to select in a control or type it in the

> or the < or the >= or the <= or the =

And use that dynamically. And that can't be done the way it was shown. You are adding an extra > to the mix.
 
I think there's a communication error here. The ARGUMENT they are talking about, unless I misread it, is the greater than symbol. So, they are wanting to select in a control or type it in the

> or the < or the >= or the <= or the =

And use that dynamically. And that can't be done the way it was shown. You are adding an extra > to the mix.
I got a bit confused by the post. Yep, you're right, it can't be done.

Even with Eval() it won't work because it will return > as a string and not an operator.
 
Ok,

So this is not possible to do this without code I guess, thanks anyhow!

Cheers

Rob
 

Users who are viewing this thread

Back
Top Bottom