FORMS CONSECUTIVE AUTO DATE

  • Thread starter Thread starter Alienmouse
  • Start date Start date
A

Alienmouse

I am trying to create a form that has five dated columns. I want the dates to
follow each other( i.e. 2-18, 2-19, 2-20...) and change each day. I've looked
though help (Word 2003) can't find a way to do this. There must be. I hope.
 
Alienmouse said:
I am trying to create a form that has five dated columns. I want the dates to
follow each other( i.e. 2-18, 2-19, 2-20...) and change each day. I've looked
though help (Word 2003) can't find a way to do this. There must be. I hope.

This is a question that comes back all the time.
The easy answer is: "Sorry, way too difficult to handle."

If you do not believe me, see the following discussion on the exact (or
almost same) question that you have (Difference being the other poster wanted
to know how to add two businees day, whereas you are asking how to add 1, 2,
3, 4 and 5 days... What about weekends, holidays, etc...)

http://groups.google.com/group/micr...:microsoft.public.word.vba.*#959b78cd4e1f5fe5
 
Hi Alienmouse,

To see how to do this and just about everything else you might want to do with dates in Word, check out my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the items titled 'Calculate a day, date, month and year, using n days delay' and 'Calculate a Stepped Date
Range'. For your purposes, you'll need to make some changes (mostly by deleting unnecessary bits of field coding). First copy both
fields to your document, then press Alt-F9 to expose the field coding.

With the first field, edit the statement 'SET Delay 1' so that it reads 'SET Delay 1' and change the 'dddd, d MMMM yyyy' mix/order
to suit your needs. This field will now display tomorrow's date. If you want today's date to display on your form, you can use a
standard DATE field for that.

With the second field, edit the coding so that it reads:
{QUOTE
{SET Delay 1}
{SET jd{=jd+Delay}}
{SET e{=INT((4*(jd+32044)+3)/146097)}}
{SET f{=jd+32044-INT(146097*e/4)}}
{SET g{=INT((4*f+3)/1461)}}
{SET h{=f-INT(1461*g/4)}}
{SET i{=INT((5*h+2)/153)}}
{SET dd{=h-INT((153*i+2)/5)+1}}
{SET mm{=i+3-12*INT(i/10)}}
{SET yy{=100*e+g-4800+INT(i/10)}}
{QUOTE"{dd}-{mm}-{yy}" \@ "dddd, d MMMM yyyy"}}
again, changing the 'dddd, d MMMM yyyy' mix/order to suit your needs. Note the change of 'SET Delay 6' to 'SET Delay 1'.

You can now make as many copies as you need of the second field, positioning them wherever you want the subsequent dates to go.

When you're done, toggle the filed codie display off again (Alt-F9), press Ctrl-A to select the whole document then F9 to update the
fields.

Cheers
 
Thank you. I needed simple, quick fix without all the angst at google group.
This works for me.

macropod said:
Hi Alienmouse,

To see how to do this and just about everything else you might want to do with dates in Word, check out my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the items titled 'Calculate a day, date, month and year, using n days delay' and 'Calculate a Stepped Date
Range'. For your purposes, you'll need to make some changes (mostly by deleting unnecessary bits of field coding). First copy both
fields to your document, then press Alt-F9 to expose the field coding.

With the first field, edit the statement 'SET Delay 1' so that it reads 'SET Delay 1' and change the 'dddd, d MMMM yyyy' mix/order
to suit your needs. This field will now display tomorrow's date. If you want today's date to display on your form, you can use a
standard DATE field for that.

With the second field, edit the coding so that it reads:
{QUOTE
{SET Delay 1}
{SET jd{=jd+Delay}}
{SET e{=INT((4*(jd+32044)+3)/146097)}}
{SET f{=jd+32044-INT(146097*e/4)}}
{SET g{=INT((4*f+3)/1461)}}
{SET h{=f-INT(1461*g/4)}}
{SET i{=INT((5*h+2)/153)}}
{SET dd{=h-INT((153*i+2)/5)+1}}
{SET mm{=i+3-12*INT(i/10)}}
{SET yy{=100*e+g-4800+INT(i/10)}}
{QUOTE"{dd}-{mm}-{yy}" \@ "dddd, d MMMM yyyy"}}
again, changing the 'dddd, d MMMM yyyy' mix/order to suit your needs. Note the change of 'SET Delay 6' to 'SET Delay 1'.

You can now make as many copies as you need of the second field, positioning them wherever you want the subsequent dates to go.

When you're done, toggle the filed codie display off again (Alt-F9), press Ctrl-A to select the whole document then F9 to update the
fields.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Alienmouse said:
I am trying to create a form that has five dated columns. I want the dates to
follow each other( i.e. 2-18, 2-19, 2-20...) and change each day. I've looked
though help (Word 2003) can't find a way to do this. There must be. I hope.
 
Alienmouse said:
Thank you. I needed simple, quick fix without all the angst at google group.
This works for me.

Sorry to have given you the wrong impression. I meant that it was difficult
if you need to work with business days only (and exclude weekends, local
holidays, etc.)

If all you need is blindly adding the next five days, whether those future
days are weekend days or not, then yes, it is much easier... Once we have
someone like macrop do the work for us...

Cheers.
 

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

Back
Top