Set value of contact field based on another field.

  • Thread starter Thread starter Tony Murnion
  • Start date Start date
T

Tony Murnion

I'm working on a custom contact form. I want to have a check box field and
a date field. When the user checks the box, I want to update the date field
with the current date. I have both fields in the form. Since I'm new to
Outlook development, I'm struggling with how to code this. Any suggestions
or samples would be greatly appreciated.

Thank you.
 
You need to bind your controls to Outlook UserProperties. The checkbox
would be a Yes/No field, the date control would be a date field (if no
date is there it will show as None, which is 1/1/4501).

Once that is done you can use the UserPropertyChange event handler to
check if the name of the changed control user property matches what
you want and handle the checking in that event handler. You would set
the date user property to either Date or Now depending on whether you
wanted a time in the control.

See the Forms information in the Developer area at www.slipstick.com
for lots more information about the event handlers and bound and
unbound fields in Outlook forms.
 
Thanks for the pointers. Once you gave me the terms I was looking for I was
able to find some reference material. I now have it working on my machine.

I now have another problem. The script I wrote works fine on my machine but
not any where else. I published the form to a public folder and the new
data fields I added to the form show up. I can see the script from another
machine (with my login) but it does not update the date fields like it does
on mine.

What am I missing?

Thanks.

--
Tony Murnion
AZ Technology Solutions, Inc.

http://www.azworld.com/services/computer.html
 
I figured it out - the script was running. I had a condition looking at the
date. I used 1/1/4501 for the comparison and found that on other machines,
the date format was 01/01/4501 so it did not find the date. Any suggestions
on avoiding this type of date issue?

Thanks.

--
Tony Murnion
AZ Technology Solutions, Inc.

http://www.azworld.com/services/computer.html
 
That's a long date/short date setting difference. You can use a set of
If tests to compensate for that and for differences in how months are
shown in US and European formats.

Test for Month(date) = 1 and Day(date) = 1 and Year(date) = 4501.
 
Back
Top