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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with If Statement

Status
Not open for further replies.

JDU

Technical User
Dec 23, 2002
182
US
In the code below the first part of the if statement executes just fine;however, when the field is blank it doesn't. Can someone tell me what's wrong.

If (RstInputAllCALApplicants.Fields(&quot;txtCALDate&quot;) <= Form_frmInputAllCALApplicants.txtDeleteDate) Or (RstInputAllCALApplicants.Fields(&quot;txtCALDate&quot;) = &quot;&quot;) Then
RstInputAllCALApplicants.Delete
End If
 
Test for null first:

if isnull(RstInputAllCALApplicants.Fields(&quot;txtCALDate&quot;)) then

'do something else

else

If (RstInputAllCALApplicants.Fields(&quot;txtCALDate&quot;) <= Form_frmInputAllCALApplicants.txtDeleteDate) Or (RstInputAllCALApplicants.Fields(&quot;txtCALDate&quot;) = &quot;&quot;) Then
RstInputAllCALApplicants.Delete
End If

end if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top