G
Guest
I recieved some ideas from my first posting but I can not get this to work.
I have a query set up that will return results based on what is entered in a
form. Is there a way I can have the query ignore a field if nothing is
entered in it? My current code is as follows but it will return everything
that matches the criteria as well as every record that has a blank for that
field. I only want the record to return if it matches that field not if it
is blank.
(([JFWorkflow Main Table].CN_PN) Like [Forms]![Search]![CN_PN] & "*" Or
([JFWorkflow Main Table].CN_PN) Is Null
I wanted to use an IIF but was told that I can not use a Like inside an IIF.
Somethink like this:
IIF(([JFWorkflow Main Table].CN_PN) Is Not Null,([JFWorkflow Main
Table].CN_PN) Like [Forms]![Search]![CN_PN] & "*",)
Any suggestions how to accomplish this?
Thanks again.
I have a query set up that will return results based on what is entered in a
form. Is there a way I can have the query ignore a field if nothing is
entered in it? My current code is as follows but it will return everything
that matches the criteria as well as every record that has a blank for that
field. I only want the record to return if it matches that field not if it
is blank.
(([JFWorkflow Main Table].CN_PN) Like [Forms]![Search]![CN_PN] & "*" Or
([JFWorkflow Main Table].CN_PN) Is Null
I wanted to use an IIF but was told that I can not use a Like inside an IIF.
Somethink like this:
IIF(([JFWorkflow Main Table].CN_PN) Is Not Null,([JFWorkflow Main
Table].CN_PN) Like [Forms]![Search]![CN_PN] & "*",)
Any suggestions how to accomplish this?
Thanks again.