View Single Post
  #3  
Old January 17th 06, 09:02 PM posted to microsoft.public.outlook.program_vba
Michael Anderson
external usenet poster
 
Posts: 19
Default Copy 1 Text Field into another on Form, DateAdd and macros

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

Ads
 

Debt Consolidation - Mobile Phones - Bad Credit Loan - Credit Card Consolidation - Car Credit