CustomPropertyChange, DateAdd and Click_event trouble

G

Guest

Below is the only code on a customised Outlook Form. In the first subroutine
I am trying to customise the Outlook Contact Form to copy 1 date Field's
value into another date Field. In the second subroutine I am trying to copy 1
text Field's value into another text Field from a cmd button.

“mxzMembershipStartDate†and “mxzMembershipRenewalMonth†are bound custom
date fields. “mxzBusinessSuburb†and “mxzOtherSuburb†are bound custom text
fields. “mxzAddressButton†is an unbound button.

I also get the Error Message 3 before the Form loads saying "Expected End of
Statement Line 3".

Nothing happens. Can anyone please tell me why?

Sub Item_CustomPropertyChange(ByVal Name)

Dim dteNextDate as Date
Dim dteDate as Date

If Name = "mxzMembershipStartDate" Then
dteDate = Item.UserProperties("mxzMembershipStartDate").Value
dteNextDate = DateAdd("m", 12, dteDate)
Item.UserProperties("mxzMembershipRenewalMonth").Value = dteNextDate
End If

End Sub

Sub mxzAddressButton_Click()

Item.UserProperties("mxzBusinessSuburb").Value =
Item.UserProperties("mxzOtherSuburb").Value

End Sub
 
K

Ken Slovak - [MVP - Outlook]

Get rid of the As clauses first of all. Not allowed in VBScript.
 

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