First, enter design mode on the form. On tab p.2, rename to "Age". Add two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add the
following code:
Datediff("yyyy",[Birthday],Now)
Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
I've managed the form design and even publishing to the organization forms
library, but I have two issues;
How can I apply this form to existing contacts?
The "age" calculated by the formula is the age at this years 'birthday", not
necessarily the current age.
i.e., if the contacts 30th birthday will be in October, the formula
currently displays age 30 today. Can the formula be changed to consider
months and days,not just years?
--
/kj
"Josh" <Jo...@discussions.microsoft.com> wrote in message
news:95FAB1E2-C340-4B2A...@microsoft.com...
To publish to existing contacts, there is a way, but I can't remember.
There is a word document that contains a script that someone made. It is
either on slipstick.com or MSDN. It gets complicated using form definitions
and such.
"kj" <k...@nowhere.com> wrote in message
news:OdmSIXCu...@TK2MSFTNGP09.phx.gbl...
It figures. But you've spurred my interest, so I will go poke around MSDN
despite it all too frequently giving me a headache. ;-)
Thanks.
--
/kj
"Joshua Heard" <jhe...@nospammsn.com> wrote in message
news:F_FVe.7420$w46....@tornado.texas.rr.com...
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"kj" <k...@nowhere.com> wrote in message news:%23htGC0J...@TK2MSFTNGP12.phx.gbl...
Perhaps you can enlighten me on this. I was expecting this formula and forms
change to save the "age" value to the contact, but it seems to only
calculate the "age" when I create the contact or "run" the form. When I save
and exit the age value is not retained.
Did I do something wrong or are my expectations amiss?
--
/kj
"Sue Mosher [MVP-Outlook]" <sue...@outlookcode.com> wrote in message
news:%23WUy5AK...@TK2MSFTNGP12.phx.gbl...
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"kj" <k...@nowhere.com> wrote in message news:eeeIUKUu...@TK2MSFTNGP09.phx.gbl...
> Thanks Sue. That formula works great except for the leap year babies as
> noted.
>
> Perhaps you can enlighten me on this. I was expecting this formula and forms
> change to save the "age" value to the contact, but it seems to only
> calculate the "age" when I create the contact or "run" the form. When I save
> and exit the age value is not retained.
>
> Did I do something wrong or are my expectations amiss?
>
> --
> /kj
> "Sue Mosher [MVP-Outlook]" <sue...@outlookcode.com> wrote in message
> news:%23WUy5AK...@TK2MSFTNGP12.phx.gbl...
> DateDiff has rounding issues. See
> http://www.slipstick.com/contacts/calcage.htm for a formula that works in
> almost every case.
>>>>>
When I create a new contact and enter the bday, the age field is calculated
and displays the correct value. But when I save the contact and later reopen
it the "age" field while still 'defined' has no value. The Bday field
remains populated. So, it seems the age field is being calculated but not
saved. Does that make sense?
(The age field does show in the custom form and "all fields" but has no
value in either after saving)
/kj
=======
You can create a custom field which calculates a value using "datediff"
function.
First, enter design mode on the form. On tab p.2, rename to "Age". Add two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add the
following code:
Datediff("yyyy",[Birthday],Now)
Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======
--
/kj
"Sue Mosher [MVP-Outlook]" <sue...@outlookcode.com> wrote in message
news:eMX1qSUu...@TK2MSFTNGP12.phx.gbl...
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"kj" <k...@nowhere.com> wrote in message news:eXhC1nUu...@TK2MSFTNGP10.phx.gbl...
> =======
> You can create a custom field which calculates a value using "datediff"
> function.
>
> First, enter design mode on the form. On tab p.2, rename to "Age". Add
> two
> new fields, "Age" and "Birthday". The Age field is a number, the birthday
> field is a date. On the Age field, go to the Value tab on the Properties.
> Under Initial Value, check "set initial value of this field to:" and add
> the
> following code:
>
> Datediff("yyyy",[Birthday],Now)
>
> Run the form. When you add the contact's birthday to the Birthday field,
> his age appears in the age field. Publish the form, and you are all set.
> ======
--
/kj
"Sue Mosher [MVP-Outlook]" <sue...@outlookcode.com> wrote in message
news:eF7ZusVu...@TK2MSFTNGP15.phx.gbl...
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"kj" <k...@nowhere.com> wrote in message news:%235lQExV...@TK2MSFTNGP14.phx.gbl...
> Sorry, I included it below;
>
>> =======
>> You can create a custom field which calculates a value using "datediff"
>> function.
>>
>> First, enter design mode on the form. On tab p.2, rename to "Age". Add
>> two
>> new fields, "Age" and "Birthday". The Age field is a number, the birthday
>> field is a date. On the Age field, go to the Value tab on the Properties.
>> Under Initial Value, check "set initial value of this field to:" and add
>> the
>> following code:
>>
>> Datediff("yyyy",[Birthday],Now)
>>
>> Run the form. When you add the contact's birthday to the Birthday field,
>> his age appears in the age field. Publish the form, and you are all set.
>> ======
>
> --
> /kj
> "Sue Mosher [MVP-Outlook]" <sue...@outlookcode.com> wrote in message
> news:eF7ZusVu...@TK2MSFTNGP15.phx.gbl...
> I don't have Josh's earlier post handy, so I don't know how you're
> implementing the age field.
>
Open / close Outlook (just to be sure), create a new contact, enter the
birthday, and the Age field shows the correct value. Save and close the new
contact. Open the contact again. The birthday is there, but the age field is
blank.
I had to do something wrong in the process, but I don't know what. I'll go
over it some again, not quite so late at night.
--
/kj
"Sue Mosher [MVP-Outlook]" <sue...@outlookcode.com> wrote in message
news:uy2RPXW...@tk2msftngp13.phx.gbl...