![]() |
#4
|
|||
|
|||
![]()
In the form of the Contact, the first combobox that I want to get the value from to the Textbox in the Task form where the Task is assigned to the contact, has the Display Name: "ComboBox7" and the Field that was created relative to ComboBox7, is: "Advisory Area"
And the Textbox in the form of the Taskform, is “Textbox20” and not with any field as a part of it. Here is the code I was given. I put it in a new Module and created the commandbotton to it in the form of the contacts, then I ran it from a contact I opened. Sub CommandButton1_Click() Dim Str Dim myItem Str =Item.GetInspector.ModifiedFormPages("General").Co ntrols("ComboBox7").Value Set myItem =Application.CreateItemFromTemplate("C:\Users\Loui s\AppData\Roaming\Microsoft\Templates\TaskFollow-Up Template.oft") myItem.Display myItem.GetInspector.ModifiedFormPages("P.2").Contr ols("TextBox20").Value= Str 'MsgBox Str End Sub And the debug shows up with the yellow color on the line: “Str =Item.GetInspector.ModifiedFormPages("General" ).Controls("ComboBox7").Value” and error is: "Run Time Error 424 Object Required" I read thru the above code I was given and it seems that it basically is that the "myitem" is the Task template and the TextBox20 which is a part of the "P.2" of the Task form, gets its value from the "Str". So is there a way, to refer to the Value of the ComboBox7 in the "Str" so it goes to the "myitem" TextBox20 area when you run the macro creating a Task asssigned to the contact you opened? |
|
![]() |
||||
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 |