A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date question



 
 
Thread Tools Display Modes
  #1  
Old January 14th, 2010, 09:45 PM posted to microsoft.public.access.forms
P-chu via AccessMonster.com
external usenet poster
 
Posts: 6
Default Date question

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 http://www.accessmonster.com

  #2  
Old January 14th, 2010, 10:51 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Date question

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())

--
Build a little, test a little.


"P-chu via AccessMonster.com" 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 http://www.accessmonster.com

.

  #3  
Old January 14th, 2010, 11: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

  #4  
Old January 26th, 2010, 07:48 PM posted to microsoft.public.access.forms
P-chu via AccessMonster.com
external usenet poster
 
Posts: 6
Default Date question

Thank you.

KARL DEWEY wrote:
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())

Can anyone help with this function:

[quoted text clipped - 11 lines]
Thanks,
P-Chu


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

  #5  
Old January 26th, 2010, 07:48 PM posted to microsoft.public.access.forms
P-chu via AccessMonster.com
external usenet poster
 
Posts: 6
Default Date question

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

Clifford Bass wrote:
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


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

  #6  
Old January 26th, 2010, 07:54 PM posted to microsoft.public.access.forms
Clifford Bass via AccessMonster.com
external usenet poster
 
Posts: 150
Default Date question

Hi,

You are welcome. Glad to help.

Clifford Bass

P-chu wrote:
This worked as well as Karl's suggestion too. Thank you.


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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.