Null Dates

S

Sharon

My code determines the [next_review_date] based on
various criteria including the [last_review_date]. Some
of the records do not have a [last_review_date]. How do
I use null so that the records with [last_review_date]
will calculate with the [next_review_date] and leave the
records without a [last_review_date] blank?

The code below still stops at records without a
[last_review_date]. What am I doing wrong?

If Me.[excpt_rate] = 0 Then
If Not IsNull(Me.[last_review_date]) Then
Me.NextReviewDate = DateAdd("m", 24, Me.
[last_review_date])
 
T

Tim Ferguson

If Not IsNull(Me.[last_review_date]) Then

If [last_review_date] is a text box control, then you need to check whether
it is empty or not:

If Len(Me.last_review_date) = 0 Then


This is why it is always a good idea to use proper type-defining prefixes
like this:

If Len(Me.txtLastReviewDate) = 0 Then

because it reminds you that you are referring to a text box, rather than to
a method or property of the form, or to a field in the recordset, etc.


HTH

Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top