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 Add Function on Forms



 
 
Thread Tools Display Modes
  #1  
Old February 4th, 2010, 03:32 PM posted to microsoft.public.access.forms
mike
external usenet poster
 
Posts: 3,942
Default Date Add Function on Forms

I'm using access to help with workflow operations.
I have a date field called "Fom 16 Signed" which is self explanatory.
I then have a field called "Form 17 Due" This is due within 7 days of the
above Form 16 being signed, so in access I want to create a date based on the
date in an exiting field + 7 days. Dead easy in excel, but cant get round it
in access.
In the default value I have typed;
DateAdd("d","7","[Date Form 16 Signed]") but keep getting syntax errors.
I'm at my wits end, until somone mentioned these forums, so here goes.
i hope you can help.
  #2  
Old February 4th, 2010, 04:20 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Date Add Function on Forms

Mike -

In the AfterUpdate event of the Form 16 Signed control, add this code:

Me.[Form 17 Due] = DateAdd("d",7,Me.[Date Form 16 Signed])

Every time the control Form 16 Signed is changed, the Form 17 Due will be
updated as well.
If you only want it updated if Form 17 Due is null, then use this:

If Me.[Form 17 Due] Is Null Then
Me.[Form 17 Due] = DateAdd("d",7,Me.[Date Form 16 Signed])
End If
--
Daryl S


"Mike" wrote:

I'm using access to help with workflow operations.
I have a date field called "Fom 16 Signed" which is self explanatory.
I then have a field called "Form 17 Due" This is due within 7 days of the
above Form 16 being signed, so in access I want to create a date based on the
date in an exiting field + 7 days. Dead easy in excel, but cant get round it
in access.
In the default value I have typed;
DateAdd("d","7","[Date Form 16 Signed]") but keep getting syntax errors.
I'm at my wits end, until somone mentioned these forums, so here goes.
i hope you can help.

 




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 10:25 PM.


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