View Full Version : Problem with Query Expression


BJ
04-26-2002, 09:54 AM
I have a query, and the criteria is based on the value of fields on my query criteria form. I seem to be having problems in my query criteria expression with one of the fields on the form. This field is a unbound combo box (value list). It's values are >, <, <>, between, like.

My expression in the query is:

[Forms]![frmQueries]![cboExpr] & "[Forms]![frmQueries]![cboCurrentStatus]"

My query comes up with no results. If I remove the first part of the expression "[Forms]![frmQueries]![cboExpr]", it works fine.

Can someone help me with this?

Thanks,
BJ

Rich
04-26-2002, 10:13 AM
I don't think you can use operators in this way

BJ
04-26-2002, 10:26 AM
I have seen this done in a database before, but I don't remember how they did it.

Can you not build this string expression?

Rich
04-26-2002, 10:32 AM
That might be possible using the strWhere, but I'm not sure that vba will recognise the operators, you might have to add a key field to the combo and use select case statements, although I can't see how you'll pass the second part of the argument when using the Between operator, interesting scenario.