Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Isnull and yes no data type 1

Status
Not open for further replies.

JAES

Technical User
Jul 25, 2004
100
GB
I use the following to determine if a file is open or not. The column CaseFileClosed is a yes/no data type with a check box. It has worked fine until I started re-opening closed files. I think when I re-open the file it is changed to 0 or 1 (can't remember which) instead of a null. What expression would I use to determine if the value is null or "no"?

If IsNull(DLookup("[casefileclosed]", "Case Files", "[Case File Number]='" & Me.vCaseFileNumber & "'")) Then

Thanks in advance for your help.
 
Perhaps this ?
If Nz(DLookup("[casefileclosed]", "Case Files", "[Case File Number]='" & Me.vCaseFileNumber & "'"), 0) = 0 Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
or rethink the data properties?

If CaseFileClosed should represent the BOOLEAN (Yes/No) status, it would make more sense (to me) to have a DEFAULT VALUE of "No" (same as Zero). Then when you CLOSE the File, set the Value True (<> 0) and when the file is initally opened, or Re-Opened, just sere-open the file, you simply set the value to False (Zero).



MichaelRed


 
Thanks guys. PHV your expression worked great. I was missing an "=0" in my attempts. Thanks again.

MichaelRed, that might also be a thought. Since the problem is with the null values, setting it to 0 to begin with might eliminate that. I'll work with that too.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top