The code in script does is not the same in a macro....I was told there are changes to a script from the contact form to do the same as a macro in the VBA.....so here is the script code that updates the Task of the Contact and all fields in the Task form from the Contact fields relate to them....so if you know what to upgrade as a macro in the VBA, that would be very helpful. Thank you very much.
Sub btnUpdateTasks_Click
dim ContactName
dim olns
dim MyFolder
dim NumItems
dim myItems
dim TaskCount
Dim Str,Str1,Str2,Str3,Str4,Str5,Str6,Str7,Str8,Str9,Str10,Str11,Str12,Str13,Str14,Str15,Str16,Str17,Str18,Str19
Dim StartDate
Dim DueDate
Dim Recipients
TaskCount = 0
Str = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox7").Value
Str1 = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox8").Value
Str2 = Item.GetInspector.ModifiedFormPages("General").Controls("TextBox5").Value
Str3 = Item.GetInspector.ModifiedFormPages("General").Controls("Initial Intro").Value
Str4 = Item.GetInspector.ModifiedFormPages("General").Controls("Intro Date").Value
Str5 = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox10").Value
Str6 = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox3").Value
Str7 = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox2").Value
Str8 = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox4").Value
Str9 = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox5").Value
Str10 = Item.GetInspector.ModifiedFormPages("General").Controls("ContactTypeComboBox1").Value
Str11 = Item.GetInspector.ModifiedFormPages("General").Controls("TextBox4").Value
Str12 = Item.GetInspector.ModifiedFormPages("General").Controls("StatusComboBox1").Value
Str13 = Item.GetInspector.ModifiedFormPages("General").Controls("TextBox20").Value
Str14 = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox6").Value
Str15 = Item.GetInspector.ModifiedFormPages("General").Controls("TextBox22").Value
Str16 = Item.GetInspector.ModifiedFormPages("General").Controls("ComboBox9").Value
Str17 = Item.GetInspector.ModifiedFormPages("General").Controls("Follow-Up ComboBox1").Value
Str18 = Item.GetInspector.ModifiedFormPages("General").Controls("TextBox3").Value
Str19 = Item.GetInspector.ModifiedFormPages("General").Controls("NextStepComboBox1").Value
StartDate = item.getinspector.modifiedformpages("General").controls("OlkDateControl4").value
DueDate = item.getinspector.modifiedformpages("General").controls("OlkDateControl3").value
ContactName = Item.GetInspector.ModifiedFormPages("General").Controls("Fullname").value
Set olns = Item.Application.GetNameSpace("MAPI")
Set MyFolder = olns.GetDefaultFolder(13)
NumItems = MyFolder.Items.Count
Set myItems = myFolder.Items
If numitems > 0 then
For I = 1 to NumItems
Set Recipients = myItems(I).Recipients
If Recipients.count > 0 then
if myitems(I).Links.Item(1).Name = ContactName Then
MyItems(I).Display
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox20").Value = Str
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox7").Value = Str1
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox24").Value = Str2
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox25").Value = Str3
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox26").Value = Str4
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox23").Value = Str5
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox8").Value = Str6
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox9").Value = Str7
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox10").Value = Str8
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox11").Value = Str9
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox12").Value = Str10
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox13").Value = Str11
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox14").Value = Str12
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox15").Value = Str13
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox16").Value = Str14
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox22").Value = Str15
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox21").Value = Str16
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox17").Value = Str17
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox18").Value = Str18
myItems(I).GetInspector.ModifiedFormPages("P.2").Controls("TextBox19").Value = Str19
myItems(I).StartDate = StartDate
myItems(I).DueDate = DueDate
MyItems(I).Save
MyItems(I).Close(0)
TaskCount = TaskCount + 1
End If
End If
Next
end if
Select case TaskCount
Case 0
msgbox "No tasks were updated."
Case 1
msgbox "One task was update successfully."
Case Else
msgbox taskcount & " tasks were updated successfully."
End Select
End Sub