Testing date field

Will04

Registered User.
Local time
Today, 12:40
Joined
May 29, 2006
Messages
62
Hi everyone,

I need some help with this problem.

I've got two date fields - DateSent and DateTstReslt

I have a field on the form that stores the no of weeks between the two dates. If there is no entry for 'DateTstReslt' then today's date is used.

What I would like to do is to ensure is that whenever 'DateTstReslt' is empty, the system should use today's date to calculate the no of weeks.

If a value is entered for 'DateTstReslt' and then deleted, what value should I check for, in order for the system to revert back to today's date in order to calculate the no of weeks?

Am I making any sense??

I tried the following

If Len(Me.DateTstReslt & vbNullString) = 0 then

also

If DateTstReslt = null then

and

If DateTstReslt = "" then

None of the above seems to be matching the value in DateTstReslt when its entry has been deleted.

What should I check for???



thanks

Will
 
have u tried

if isnull(datetstresult) then?
 
Hi rainman,

Thanks for your response. I tried it but it still does not work..

Here's the code I'm using..

'***************
Private Sub DateTstReslt_AfterUpdate()

If IsNull(datetstresult) Then
Text7 = DateDiff("ww", [DateSmearSent], Date)
Text9 = "Outstanding"
Else
Text7 = DateDiff("ww", [DateSmearSent], DateTstReslt)
Text9 = "Turnaround Time"
End If
End Sub
'***************
When I enter a value for DateTstReslt and then delete the value, the 'Else ' part of the code is being executed and the DateDiff() functions returns 0.

Any other suggestions??

Appreciated

Will
 
I note a different spelling in there. Is that a factor? I usually use the first test you have in your first post.
 
Hi Paul & Rainman

Yep.. it was a typo.....

Thanks so much.. it works just fine now...

Much appreciated



Will
 

Users who are viewing this thread

Back
Top Bottom