PDA

Click to See Complete Forum and Search --> : Record Selection Problem


brooksdotnet
Aug 26th, 2004, 01:50 AM
I've got a Parameter called {?Action}. The user may choose not to set that parameter - so it will get a value of "" if the user doesn't give it a value.

The Action field in the database may be NULL, "", or a value. My record selection formula works when the Action field is not NULL or "", but it doesn't work otherwise

Here's my Record Selection Formula:



IIF(Len(Trim({?Action})) > 0, {Action} = {?Action}, ({Action} <> '' OR {Action} = '' OR IsNull({Action})))

This will return all rows where there is some kind of value in the Action field but will not return any NULL or '' values. Ugh.

Any help?

Thanks!

brucevde
Aug 26th, 2004, 10:11 AM
The parameter is optional, either use it or don't. If the Action parameter exists. then the Action field must equal the parameter. If it does not exist then there is no reason to do any checks.

Try this...

If Len(Trim({?Action})) > 0 Then {Action} = {?Action}