I have a userform with a 2 option button's in a Groupbox. I would like to use
these as the criteria of a query if possiable. The option buttons value's are
1 and 2.
So I thought I could say............In the Criteria of TENDER_TYPE
IIf([Forms]![PDetail_Form]![Frame_Coupons]=1,([TENDSALE].[TENDER_TYPE])<500,([TENDSALE].[TENDER_TYPE])>=500)
but this returns nothing in the query. Am I missing something?
Thanks Mike
>I have a userform with a 2 option button's in a Groupbox. I would like to use
>these as the criteria of a query if possiable. The option buttons value's are
>1 and 2.
>So I thought I could say............In the Criteria of TENDER_TYPE
>IIf([Forms]![PDetail_Form]![Frame_Coupons]=1,([TENDSALE].[TENDER_TYPE])<500,([TENDSALE].[TENDER_TYPE])>=500)
>but this returns nothing in the query. Am I missing something?
The Criteria in the query design grid is compared to the
field, so you end up comparing TENDER_TYPE to True of False,
which is probably menaingless.
Try using your expression as a calculated field in the Field
row and setting its Criteria to True

Signature
Marsh
MVP [MS Access]
John Spencer - 31 Oct 2007 12:58 GMT
You can use something which is not efficient since it cannot use any indexes
and must do a calculationi for every row and cannot be used other than in
Access
Field:
IIf([Forms]![PDetail_Form]![Frame_Coupons]=1,([TENDSALE].[TENDER_TYPE])<500,([TENDSALE].[TENDER_TYPE])>=500)
Criteria: <> False
Note that the IIF expression is entered in a field "box" and the criteria
under the expression is entered as <> false

Signature
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.
>>I have a userform with a 2 option button's in a Groupbox. I would like to
>>use
[quoted text clipped - 11 lines]
> Try using your expression as a calculated field in the Field
> row and setting its Criteria to True