Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / December 2005

Tip: Looking for answers? Try searching our database.

null function in criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JeffMKlein - 01 Dec 2005 23:01 GMT
I am using a function (fClientName) in the criteria of my query.  Is there a
way to show all records if this function is "" or null?
eg:  If nothing is selected then all records show.
Tom Ellison - 01 Dec 2005 23:06 GMT
Dear Jeff:

In a criterion of the query, test the function's result.  Since the function
may return "" or NULL, you can test both, with OR between:

   (fClientName() = "" OR fClientName() IS NULL)

I put this in parens in case you have other criteria.

If you wish, use:

   Nz(fClientName(), "") = ""

The Nz function changes NULL into whatever you choose, in this case "".

Tom Ellison

>I am using a function (fClientName) in the criteria of my query.  Is there
>a
> way to show all records if this function is "" or null?
> eg:  If nothing is selected then all records show.
Sunil - 02 Dec 2005 04:50 GMT
hi jeff,

u can also use IsNull(fClientName() ) in ur query

thanks
sunil.t

> Dear Jeff:
>
[quoted text clipped - 17 lines]
> > way to show all records if this function is "" or null?
> > eg:  If nothing is selected then all records show.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.