B
betwalk
Hi-
I'm trying to set up a query that will obain its criteria from a form
in which the user can indicate how they wish to filter the query. One
example is a MemberType field that could be used for filtering. I have
no trouble filtering when the user DOES indicate a Member type (via a
combo box), but when the user chooses not to filter based on Member
type and leaves that combo blank, I cannot get it to work.
The form where the user can indicate the filtering preference is called
"frmMergeChoices" Here are the various IIF statements that I've tried
to use.
IIf(Not
IsNull([Forms]![frmMergeTest]![cboGetType]),[Forms]![frmMergeChoices]![cboGetType])
IIf(Not
IsNull([Forms]![frmMergeTest]![cboGetType]),[Forms]![frmMergeChoices]![cboGetType],
Like "*")
IIf(Not
IsNull([Forms]![frmMergeTest]![cboGetType]),[Forms]![frmMergeChoices]![cboGetType],"")
IIf(Not
IsNull([Forms]![frmMergeTest]![cboGetType]),[Forms]![frmMergeChoices]![cboGetType],null)
As you can see, it's that 3rd argument of the IIF that I'm trying to
get. When cboGetType has data, the query works just fine, but if left
empty, it doesn't work. I'm trying to get Access to treat the criteria
column as if it were empty, but the presence of the IIF is making it
not work.
Eventually, I was hoping to use this technique to set up a form where
any one of a number of criteria could be indicated and then have a the
query sense which combos have criteria and which do not.
Thanks in advance for any/all suggestions-
Betsy
I'm trying to set up a query that will obain its criteria from a form
in which the user can indicate how they wish to filter the query. One
example is a MemberType field that could be used for filtering. I have
no trouble filtering when the user DOES indicate a Member type (via a
combo box), but when the user chooses not to filter based on Member
type and leaves that combo blank, I cannot get it to work.
The form where the user can indicate the filtering preference is called
"frmMergeChoices" Here are the various IIF statements that I've tried
to use.
IIf(Not
IsNull([Forms]![frmMergeTest]![cboGetType]),[Forms]![frmMergeChoices]![cboGetType])
IIf(Not
IsNull([Forms]![frmMergeTest]![cboGetType]),[Forms]![frmMergeChoices]![cboGetType],
Like "*")
IIf(Not
IsNull([Forms]![frmMergeTest]![cboGetType]),[Forms]![frmMergeChoices]![cboGetType],"")
IIf(Not
IsNull([Forms]![frmMergeTest]![cboGetType]),[Forms]![frmMergeChoices]![cboGetType],null)
As you can see, it's that 3rd argument of the IIF that I'm trying to
get. When cboGetType has data, the query works just fine, but if left
empty, it doesn't work. I'm trying to get Access to treat the criteria
column as if it were empty, but the presence of the IIF is making it
not work.
Eventually, I was hoping to use this technique to set up a form where
any one of a number of criteria could be indicated and then have a the
query sense which combos have criteria and which do not.
Thanks in advance for any/all suggestions-
Betsy