lms
07-04-2013, 06:44 PM
I have a code which I will show below that 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.
In addition, it automatically links the contact from where I am clicking on the CommandButton4 to the Task as an Assigned Task.
So what I need please is how to add to the code or create another code (and where to put it) that after a Task is created per this process, and I later change a value in a ComboBox or TextBox 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.
Thanks very much.
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").Controls("TextBox20").Value = Str
myItem.GetInspector.ModifiedFormPages("P.2").Controls("TextBox7").Value = Str1
myItem.Links.Add Item
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.
In addition, it automatically links the contact from where I am clicking on the CommandButton4 to the Task as an Assigned Task.
So what I need please is how to add to the code or create another code (and where to put it) that after a Task is created per this process, and I later change a value in a ComboBox or TextBox 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.
Thanks very much.
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").Controls("TextBox20").Value = Str
myItem.GetInspector.ModifiedFormPages("P.2").Controls("TextBox7").Value = Str1
myItem.Links.Add Item
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.