Copy 1 Text Field into another on Form, DateAdd and macros
Ah. Well, in the event that you still wanted to handle clicks, you would
embed the macros the same way you created the custompropertychange event
handler. only it would be a click handler. Then you'd just check what they
clicked on, and then execute the proper code - or do nothing.
I personally like to leave buttons out of it if possible. Your use of the
CustomPropertyChange event is preferrable.
Thanks,
Tangent
"Michael Anderson" wrote in
message ...
THanks for your help.
RE 3rd question - I want to embed these macros on a form. When the form
loads, these macros would be embedded in it. 1 of these cmd_click()macros
performs the actions of the 1st question. The other cmd_click()macro
updates
another date field (see 2nd question). I was asking this in case the
direct
programming on the forms didn't work. (Like 2nd Question - ie Sub
Item_CustomPropertyChange(...))
--
Thank You in Advance,
Michael Anderson
"Tangent" wrote:
Well, it's really the same soultion: You have to pull the objects from
the
Item.UserProperties() collection to do things with them. This is also
why
your function does not work. Something like this works:
Sub Item_CustomPropertyChange(ByVal Name)
If Name = "dateField1" Then
dteDate = Item.UserProperties("dateField1").Value
dteNextDate = DateAdd("m", 12, dteDate)
Item.UserProperties("dateField2").Value = dteNextDate
End If
End Sub
Update other textboxes the same way. If you are entering data in to
builtin
fields, just make sure you access them through the right collection.
Regarding loading two macros with a form, I'm not sure what you're
asking.
Do you want to embed the macros in the form? Or do you want to launch
macros
that exist in your VBAProject.OTM (these are the macros that you see in
the
Tools Macros... list, they are specific to each PC's VBAProject.OTM
file
unless you have a deployment soultion in place).
Thanks,
Tangent
"Michael Anderson" wrote:
1. How do I copy 1 text Field's value into another text Field from a
cmd
button? I am trying to customise the Outlook Contact Form. I notice
that
there is no code underneath it and so I can't debug it with MS Script
Editor.
2. Why doesn't the code below work? I've used DateAdd to add 12 months
on to
a date...
-- below is code -- (mxz...is a user-defined prefix)
Sub Item_CustomPropertyChange(ByVal Name)
If Name = "mxzMembershipStartDat" Then
Dim dteNextDate As Date
Dim dteDate As Date
dteDate = dtemxzMembershipStartDat
dteNextDate = DateAdd("m", 12, dteDate)
dtemxzMembershipRenewalMonth = dteNextDate
End If
End Sub
3. How can i get 2 macros to load automatically with a form?
--
Thank You in Advance,
Michael Anderson
|