![]() |
#5
|
|||
|
|||
![]()
I have a code which is put in the View Code/Script Editor of the form of the Contact. It creates a Task and puts in the TextBoxes of the Task form, the Values from the ComboBoxes or TextBoxes from the Contact that the Task is created from. So in the form of the Contact, there is the new CommandButton4 that when I click on in the Contact, it creates the Task and the brings the Values from the ComboBoxes or TextBoxes from the Contact that the Task is created from to the TextBoxes in the Task created.
So what I need please is how to add to the code or create another code (and where to put it) that will assign the Contact to the Task, just like the "Assign Task" when I click on the CommandButton4, and then at the bottom of the Task, it shows the link to the Contact. And the second area, is after a Task is created per this process, and I later change a value in a ComboBox of the Contact that gets assigned to the Task, how can it upgrade the TextBox(s) of the Task with the current Value? Here is the Code that is working, how it is drafted, and it is put in the View Code/Script Editor of the form of the Contact, and the Contact form is published in the normal way. Sub CommandButton4_Click Dim Str,Str1, Dim myItem Str = Item.GetInspector.ModifiedFormPages("General").Con trols("ComboBox7").Value Str1 = Item.GetInspector.ModifiedFormPages("General").Con trols("ComboBox8").Value Set myItem = Application.CreateItemFromTemplate ("C:\Users\Stoler Law\AppData\Roaming\Microsoft\Templates\Task Follow-Up.oft") myItem.Display myItem.GetInspector.ModifiedFormPages("P.2").Contr ols("TextBox20").Value = Str myItem.GetInspector.ModifiedFormPages("P.2").Contr ols("TextBox7").Value = Str1 End Sub This code is working by drafting it this way: In the contact form, there is the new CommandButton4. In the Str lines, each line refers to a ComboBox in the form of the Contact, and the ( ) area after "Controls" is the Display Name of the the Combobox. The Set myItem line, refers to the the form of the Task form that I added the Textboxes to, and saved to my template area. In the myItem line, the ("P.2") refers to the Page 2 of the Task form, and the the area ( ) after Controls is the Display Name of the TextBox that is to get the Value from the particular ComboBox of a Str line. And when I created the Task P.2 area, that's where I put in the TextBox(s) and I created a new field for each one so it is stored. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to populate textbox based on combobox selection in word | IvanGeorgiev | Word | 1 | 02-21-2013 07:32 PM |
![]() |
IvanGeorgiev | Word VBA | 1 | 02-21-2013 07:28 PM |
PowerPoint 2007 Textbox Lock / Form Issues | LTechie12 | PowerPoint | 0 | 01-08-2012 02:08 PM |
![]() |
ilkks | Word VBA | 7 | 05-25-2011 04:06 AM |
Textbox updating from combobox selection | paxile2k | Word VBA | 0 | 10-26-2010 02:30 PM |