Date question

  • Thread starter P-chu via AccessMonster.com
  • Start date
P

P-chu via AccessMonster.com

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
 
K

KARL DEWEY

Try this --
Completion_Date: IIF([Date Parts Ordered Completed] Is Null OR [Date Part
Completed] Is Null OR [Date Purchasing Completed] Is Null, Null, Date())
 
C

Clifford Bass via AccessMonster.com

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 said:
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
 
P

P-chu via AccessMonster.com

This worked as well as Karl's suggestion too. Thank you.

Clifford said:
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
Can anyone help with this function:
[quoted text clipped - 11 lines]
Thanks,
P-Chu
 

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