Date Calculation

  • Thread starter Thread starter Lisa Angelo
  • Start date Start date
L

Lisa Angelo

I am trying to display on my forms a message to inform
users the status of various projects. When it is assigned
there is always a date recorded in my main table. If they
do not enter this date no record can be created. My goal
is to always inform them in a field on the form how many
days they are behind. After say 4 days I would just post
a summary message saying the project is more than 4 days
late and the manager must be notified. I have tried
creating a expression in a query my form uses but I am
having no luck. Can anyone help me?

Thanks,
Lisa
 
Lisa

It sounds like you want to compare the DateAssigned and today's date (you
can use the Date() function for this). If you take the difference between
these two, and it exceeds, say "4", you could include your message. Check
the IIF() function for a way to do both the checking and the message in a
query.
 
I placed this into my forms current event and it works
almost:

Private Sub Form_Current()
If (DATE - [RECIEVED] > 3) Then
MsgBox ("This search is over 3 days past due!")
End If
End Sub

But when I add to it:
If (DATE - [RECIEVED] > 3) AND [COMPLETED]NOT NULL

It fails and I must make sure there is no completed date
because even if it was entered late I would not want a pop
up message. Any help or input would be greatly appreciated.

Thank you,
Lisa
 
Lisa

How about if you embed the date comparison within an outer check for
COMPLETED? Something like (actual syntax may vary):

If IsNull([COMPLETED] Then
'?do something
Else
If (DATE - [RECEIVED] > 3) Then
'do this
End If
End If
 
Back
Top