View Single Post
Old 10-18-2013, 04:04 AM
BoringDavid BoringDavid is offline Windows XP Office 2010 32bit
Join Date: Sep 2013
Posts: 19
BoringDavid is on a distinguished road

Originally Posted by macropod View Post
The function you need is most likely DateDiff. The attached demo, using a Calendar Control, should get you started. Considerably more code would be needed to return the number of year months and month days.
Thanks for your help macropod. Although I am now struggling to input the DateDiff function into the document! Just to clarify, I don't need it as a Message Box, but for it to become text to input into the documnet itself.

I have tried to do this by

Dim TheDate As Date
Dim AgeofPlan As Date
TheDate = DTPStartDate.Value
AgeofPlan = DateDiff(yyyy, TheDate, Now)

But keep getting a Run-time error '5': Invalid procedure call or argument on the last line.
Reply With Quote