DISPLAYING THE DAYS SINCE AN EVENT

C

calsax

I need to be able to display the number of days since an event. I would like
to have the document creator input a date, then have a display that shows the
number of days since that date at print. Any suggestions?

Thanks!
 
D

Doug Robbins - Word MVP

Use the DateDiff() function.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
M

macropod

Hi calsax,

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 item titled 'Calculate the # Days Difference Between Two Dates'. With that example, you could substitute
a formfield or a userform to set the 'StartDate' bookmark's value. Alternatively, you could embed and ASK field in the calculation
field, as per some of the other examples in that document.

Cheers
 
C

calsax

Thank you! It looks like you gave me what I need. I am far more comfortable
in Access or Excel than Word, but when the boss says "can this be done" and
you naively say "sure", you just have to move forward.

Thanks!!!!!!!
 
C

calsax

The code in your "Tips & Techniques" works great! I used the "Days
Difference" code with an Ask for the start date. Now for one more question:

How can I have the document automagically update the displayed values in the
fields at print time (or when the doc is opened) to reflect to current values?

Thanks again for all your help!!!!

calsax
 
C

Compass Rose

Calsax

If you go to Tools -> Options... -> Print tab, check the 'Update fields'
box, and your
ASK fields will prompt the user for input before each time the document is
printed. If the user has previously put data into ASK box, the data will
appear in the box and all they have to do is click OK or change the data if
they wish.

David
 
M

macropod

Hi Calsax,

BTW, although you've posted in a vba newsgroup, the solution I directed you to is not vba - it uses Word fields instead. As a
result, it doesn't raise any of the security issues you might get with vba.

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

Top