|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
MS Access help
OK, I'm running a query on a table, and I need to filter down by input on a form. Here's what I have on the Critieria field for the particular data field:
IIF(IsNull(F_BU()), " (???) ", F_BU()) F_BU() is the returned value (integer) from input... If the user inputs a number then the results are filtered down by that value just fine, BUT if the user leaves the input null, then I don't want to filter down by that field (ie, display all results that made it through the previous filters). If I just leave empty quotes (the " (???) " is what is in question), it filters down by results that have that field null (which there are none of)...I want to display ALL results if the returned value is null. I've tried wildcards and >0 but no luck. Any ideas? Let me know if I need to elaborate/more detail.... TIA
__________________
"It is the way of man to make monsters and it is the nature of monsters to destroy their makers." |
|
|
|
|
|
#2 |
|
Come in Ray...
Join Date: Sep 2004
Posts: 1,668
|
I'm assuming you are using this in a query statement, in which case it would be:
Code:
SELECT IsNull( [field name], [value to return if null... usually 0 or ''] ) AS FieldValue Code:
Variable = IIf( F_BU() Is Nothing, " ??? ", F_BU() ) |
|
|
|
|
|
#3 |
|
Wx geek
Join Date: Aug 2005
Location: Indiana
Posts: 6,638
|
Thanks...I ended up doing it another way. When you clicked on the button to run this query, if it was null, I ran a seperate query that didn't filter by that field, and if it wasn't null...then I ran another query that did filter...I may be back with more questions...
|
|
|
|
|
|
#4 | |
|
Come in Ray...
Join Date: Sep 2004
Posts: 1,668
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|