Thread: Date question
View Single Post
  #3  
Old January 14th, 2010, 10:16 PM posted to microsoft.public.access.forms
Clifford Bass via AccessMonster.com
external usenet poster
 
Posts: 150
Default Date question

Hi P-chu,

Create an After Update event on all three of the fields. In each add
the single line:

UpdateFinalDate

This will call a subroutine named "UpdateFinalDate" that you will add to
the form's code module (air code/untested/may need tweaking).

Private Sub UpdateFinalDate()

If IsNull([Date Parts Ordered Completed]) Or _
IsNull([Date Part Completed]) Or _
IsNull([Date Purchasing Completed]) Then
If Not IsNull([Final Date Field]) Then
' Ask user if the existing date should be kept
' or cleared and do as the user indicates
End If
Else
If IsNull([Final Date Field]) Then
[Final Date Field] = Date()
Else
' Possibly ask the user if the final date should
' updated and do so if the user so indicates
End If
End If

End Sub

Hope that helps,

Clifford Bass

P-chu wrote:
Can anyone help with this function:

=IF[Date Parts Ordered Completed]+ [Date Part Completed]+[Date Purchasing
Completed],not blank,=Date

The goal is that is all three fields have a date in them, then put in today's
date in the final field. If one of the dates is missing, then the final date
is blank. The only problem is if I open up that form I do not want it to
change the date to today. I want it to stay the date of the actual
completion.

Any help is greatly appreciated.

Thanks,
P-Chu


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201001/1