Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-29-2013, 01:13 PM
lms lms is offline Outlook 2007 Code For Matching Textbox to a Combobox in a Different Form Windows 7 64bit Outlook 2007 Code For Matching Textbox to a Combobox in a Different Form Office 2007
Novice
Outlook 2007 Code For Matching Textbox to a Combobox in a Different Form
 
Join Date: Jun 2013
Posts: 9
lms is on a distinguished road
Default

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?
Reply With Quote
 



Similar Threads
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
Outlook 2007 Code For Matching Textbox to a Combobox in a Different Form how to populate textbox based on combobox selection in word 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
Outlook 2007 Code For Matching Textbox to a Combobox in a Different Form Code to export value from ComboBox 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

Other Forums: Access Forums

All times are GMT -7. The time now is 06:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft