Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / November 2006

Tip: Looking for answers? Try searching our database.

Auto Date Calculation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luke Slotwinski - 02 Nov 2006 04:07 GMT
In designing a form I have a Date Picker field to choose Date Received.
I would like to create a field which would Auto insert a date that is Date
Received +10 days.   Example... if Date Received was 11/10/06 I want the
field Date Due to auto insert 11/20/06.

Thank you,
Luke Slotwinski
S.Y.M. Wong-A-Ton - 02 Nov 2006 06:54 GMT
If you are using InfoPath 2007, you can use the built-in "addDays" function
to do this. If you're using InfoPath 2003, you'll have to code it yourself.
Search this newsgroup on "add days" to find samples on how to do this.
---
S.Y.M. Wong-A-Ton

> In designing a form I have a Date Picker field to choose Date Received.
> I would like to create a field which would Auto insert a date that is Date
[quoted text clipped - 3 lines]
> Thank you,
> Luke Slotwinski
Luke Slotwinski - 07 Nov 2006 05:38 GMT
Wong-A-Ton:
I am in InfoPath 2003... I searched the newsgroup but could not find exactly
what im looking for.  I found  
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.infopath&mid=8eb30843-25b5-4da3-a3f3-1e08183237b7&sloc=en-us

; which is close to what I need.  I have a field rcv_date and want the next
field due_date to be +10 days from rcv_date.  The examples listed under the
two URL's you posted to that reply do not show how to link it to another
field.  If I create the function..

function addtendays()
{
dtNextWeek = new Date();
dtNextWeek.setDate( dtNextWeek.getDate()+10 );
alert( dtNextWeek );
}

Where do I put this function?  And how can I get it to bind to due_date field?

Luke Slotwinski

> If you are using InfoPath 2007, you can use the built-in "addDays" function
> to do this. If you're using InfoPath 2003, you'll have to code it yourself.
[quoted text clipped - 9 lines]
> > Thank you,
> > Luke Slotwinski
Russ - 07 Nov 2006 21:01 GMT
You can call that function from within the OnAfterChange event handler for
the rcv_date field.  Add the OnAfterChange event handler by locating the
field in your form's data source, double click, select "validation and event
handlers" tab, select OnAfterChange from the events box, click edit.

Then you'll need to update the due_date field with the new date, which you
can do:

xmlDueDate = XDocument.DOM.selectSingleNode(xpath to due_date)
xmlDueDate.text = dtNextWeek

Something like that should work.

> Wong-A-Ton:
> I am in InfoPath 2003... I searched the newsgroup but could not find exactly
[quoted text clipped - 29 lines]
> > > Thank you,
> > > Luke Slotwinski
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.