Go Back   PCMech Forums > Help & Discussion > Software Discussion & Support

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 07-05-2006, 04:31 PM   #1
Wx geek
 
blue60007's Avatar
 
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."
blue60007 is offline   Reply With Quote
Old 07-06-2006, 08:12 AM   #2
Come in Ray...
 
faulkner132's Avatar
 
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
If you are using the IIF statement in your code:
Code:
Variable = IIf( F_BU() Is Nothing, " ??? ", F_BU() )
faulkner132 is offline   Reply With Quote
Old 07-06-2006, 08:35 AM   #3
Wx geek
 
blue60007's Avatar
 
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...
blue60007 is offline   Reply With Quote
Old 07-06-2006, 08:38 AM   #4
Come in Ray...
 
faulkner132's Avatar
 
Join Date: Sep 2004
Posts: 1,668
Quote:
Originally Posted by blue60007
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...
That works, but it may be best to consolidate to a single query. This way if your DB changes or you need to modify the query, you only have to change it in one place.
faulkner132 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:05 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2