Hi,
I use a form to call up a report. I use some fields in the form as criteria to filter some data in the queries that feed my sub reports. What I want to do is : if a field (lets say agency) in the form is blank, then return all lines and if it's not blank, return agency.value. O.K. I'm not the most experienced but I pretty much know my way around. I use a IFF statement as my criteria that looks like this.
It works when you have a selection in your form for agency but otherwise it doesn't.
As the last part of my IIF statement, I've tried *, "*", [*], >= " ", Like "[A-z]*", or just about anything else you could dream of.
I even tried
>=IIF([Forms]![SelectionForm]![agency]<>"";[Forms]![SelectionForm]![agency]<>"";A) or something I don't recall and this would work if there's nothing in the field but wouldn't ( and I understand why! ) when there was a selection in agency, returning not only the selection but anything greater.
What am I doing wrong, is there a better way (not only in the criteria)?
Thanks
Jean-François, Montréal
I use a form to call up a report. I use some fields in the form as criteria to filter some data in the queries that feed my sub reports. What I want to do is : if a field (lets say agency) in the form is blank, then return all lines and if it's not blank, return agency.value. O.K. I'm not the most experienced but I pretty much know my way around. I use a IFF statement as my criteria that looks like this.
Code:
IIF([Forms]![SelectionForm]![agency]<>"";[Forms]![SelectionForm]![agency]; ___ )
As the last part of my IIF statement, I've tried *, "*", [*], >= " ", Like "[A-z]*", or just about anything else you could dream of.
I even tried
>=IIF([Forms]![SelectionForm]![agency]<>"";[Forms]![SelectionForm]![agency]<>"";A) or something I don't recall and this would work if there's nothing in the field but wouldn't ( and I understand why! ) when there was a selection in agency, returning not only the selection but anything greater.
What am I doing wrong, is there a better way (not only in the criteria)?
Thanks
Jean-François, Montréal