Do I use "0" or 0

hbaggs

Registered User.
Local time
Today, 09:05
Joined
Feb 5, 2004
Messages
39
I wonder which is correct

If IsNull(DLookup("PrivateContractFee", "tblAllStatementTEMP")) Or (DLookup("PrivateContractFee", "tblAllStatementTEMP")) = "0" Then
objDoc.Bookmarks("PrivateContract").Select
objWRD.Selection.Rows.Delete
End If


or is it ?


If IsNull(DLookup("PrivateContractFee", "tblAllStatementTEMP")) Or (DLookup("PrivateContractFee", "tblAllStatementTEMP")) = 0 Then
objDoc.Bookmarks("PrivateContract").Select
objWRD.Selection.Rows.Delete
End If



Also is this use of OR acceptable?
 
If you are just checking if it contains any records then Dcount is better

Code:
If DCount("*", "tblAllStatementTEMP") = 0 Then
   objDoc.Bookmarks("PrivateContract").Select
   objWRD.Selection.Rows.Delete
End If

If you actualy need to check for a 0 in the record as well then
If DCount("*", "tblAllStatementTEMP") = 0 Or DLookup("PrivateContractFee", "tblAllStatementTEMP") = 0 Then

You should only need to quote the 0 if PrivateContractFee is a text field HTH

Peter
 
thank you

thank you for your help
 
Date literals are delimited with #
#2/23/2006#
Text literals are delimited with "
"this is a text field" as is this - "2334"
Numeric literals are NOT delimited
2334
 

Users who are viewing this thread

Back
Top Bottom