Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / October 2007

Tip: Looking for answers? Try searching our database.

Using Option Group for Criteria of query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 31 Oct 2007 01:12 GMT
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
Marshall Barton - 31 Oct 2007 05:03 GMT
>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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.