![]() |
|
Form issues
Thank you for all your help, I don't know why, but I can't make this work. I
am going to walk away and give up on this particular code. Thank you again. I just can't seem to understand. "Sue Mosher [MVP-Outlook]" wrote: Three issues he 1) strMyProp1 = Item.UserProperties(“CheckBox3”) CheckBox3 looks like the name of a control, not the name of an Outlook property, which is what UserProperties needs. 2) If you have multiple custom properties, you don't want the value in TextBox13 to change every time any of those properties changes value, do you? That's where the Name parameter comes in. Use it -- as shown in the sample -- to structure your code so that you get the desired change in TextBox 13 *only* when the one property bound to the check box changes value. 3) Select Case strCheckBox3 = True You have no End Select statement. You have no code to set a value for strCheckBox3, which means this expression -- (strCheckBox3 = True) -- thus always returns False. And you have no Case statements. An If ... Then ... End If block would be more appropriate for working with the value of a check box or yes/no property. -- 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 "daphnejean77" wrote in message ... I am now trying to write a code using the CustomPropertyChange and I am not doing something right, only I am not sure what it is. I have a checkbox that I need to trigger the Now () formula into a text box and I cannot make this code work I think I am just completely off base on this one. Sub Item_CustomPropertyChange(ByVal Name) Set objPage = Item.GetInspector.ModifiedFormPages("Task Manager") strMyProp1 = Item.UserProperties(“CheckBox3”) Select Case strCheckBox3 = True Set objControl = objPage.Controls("TextBox13") objControl.Text = Now() Set objControl = Nothing Set objPage = Nothing End Sub "Sue Mosher [MVP-Outlook]" wrote: That's because you need to use a different event if you're using a bound control, CustomPropertyChange. See http://www.outlookcode.com/d/propsyntax.htm for sample code. "daphnejean77" wrote in message ... Once I follow those instructions, the code no longer allows the time stamp to populate the correct field. "Sue Mosher [MVP-Outlook]" wrote: You need to follow Hollis' instructions for creating the check boxes so that they are bound to Outlook properties. "daphnejean77" wrote in message ... I am using a code using the checkboxes and I am having the same problem. The Checkboxes will not stay checked once my form has been saved and closed. The code I am using is this: Sub CheckBox3_Click() Dim objNS Dim objPage Dim objControl Set objNS = Application.GetNamespace("MAPI") Set objPage = Item.GetInspector.ModifiedFormPages("Task Manager") Set objControl = objPage.Controls("TextBox13") objControl.Text = Now() Set objControl = Nothing Set objPage = Nothing Set objNS = Nothing End Sub How do I make the check box stay checked? "Hollis Paul [MVP - Outlook]" wrote: In article , =?Utf-8?B?U25ha2VfUGxpc2tlbg==?= wrote: I am using Office/ Outlook 2003 if that is more helpful. In the form design mode I clicked on the All Fields tab and gave both fields yes/no values. No, that is not how you do it. When you are in that All Fields Tab, you would look down at the bottom left corner and see a button saying New. Click that, and up pops a small dialog. Put a name in the name field. In the Type field choose the yes/No option from the drop down list, and in the Format field choose the appropriate display you want to see. I believe that the Icon choice will show the checkmark. Once you have a field set up, you go back to the tab that shows the code, right-click the control, choose properties, and on the tab of the dialog that pops up, click the Choose Field to drop down the choice of categories, select the appropriate one, and then your field. You will then see all your field's parameters displayed in the property box. Now, the control is bound to that field. You can publish your form, and you are good to go, as the commercial so aptly puts it. Notice that when that control properties panel opens up, there is a New button to the right of the choose field business. You can create your new field there, just as you did from the All Fields tab. -- Hollis Paul Mukilteo, WA USA |
All times are GMT +1. The time now is 07:53 AM. |
|
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright 2004-2006 OutlookBanter.com