John,
Got it to work; thought you might be interested ---
1. Added following field to query:
InspDate: NZ([InspectionDate],"InspectionDateIsNull")
2. Added following criteria to InspDate:
Choose([Forms]![PFrmFindOrderToCallToScheduleInspection]![InspectionDateSet],"InspectionDateIsNull",[InspectionDate],NZ([InspectionDate],"InspectionDateIsNull"))
** [InspectionDateSet] is the name of the option group.
When [InspectionDateSet] is 1, the query returns all records where
[InspectionDate] is null.
When [InspectionDateSet] is 2, the query returns all records where
[InspectionDate] is not null.
When [InspectionDateSet] is 3, the query returns all records.
Steve
John Vinson said:
Thanks, Doug!
I can get the Is Not Null part in the below but can not get the Is Null
part. Do you have any ideas?
Choose(Forms!MyForm!MyOptionGroup,Is Null,[MyField])
Steve
Steve, any function - IIF, Switch, Choose, etc. - can return a
*VALUE*. However it cannot return an *operator* such as IS NULL.
AFAIK the only way to get this to work would be to dispense with the
function altogether with a syntax like
WHERE (fieldname IS NULL AND Forms!MyForm!MyOptionGroup = 1)
OR (fieldname = [MyField] AND Forms!MyForm!MyOptionGroup = 2)
John W. Vinson[MVP]