Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2013, 12:35 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 Outlook 2007 Code For Matching Textbox to a Combobox in a Different Form

When I created the Task form, in the Page called P2, I added to the Page P2 from the Control Toolbox two text boxes.


In my default form for contacts, I have added a Combobox and in the Value area as to Choose a Field, it is a Text Field that I created, the Type is "Dropdown", the Property to Use is "Value", and then under Possible Values, I wrote in a list of words and phrases where at the end of each phrase is a semicolon, which under the Combobox, each phrase shows up part of a drop list, and I just identify which phrase I want to show in the Combobox field on the Contact.

And the other type of Combobox as to Choose a Field, is a Date/Time field and nothing else to add to it, so in the field of the Date/Time in the Contact, I just type in the appropriate date.

So when I open a contact and create the Task by using the Assign Task to the contact, or in the list of contacts, I click on a contact (not open it), go to Actions, Create, New Task For Contact, how can each "Text Box" in the Task receive the value decided from the drop list from a specific Combobox in the Contact.

Does anyone know the code and where I should put it please?


Also, does it makes sense to create Comboboxs in the Task form that are the same of the Comboboxs in the Contact form, and create the code that makes the Comboboxs of the Task form automatically use the Value from the Comboboxs that are the same in the Contact that gets Assigned to the Task in the two different ways I mentioned above.



So I don’t care which way to do it, just need to know and get the code and where to put it.

Thanks much as I need this as soon as possible from someone!
Reply With Quote
  #2  
Old 06-16-2013, 10:44 AM
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

Would love to hear back from someone that can show me how to do it re above.
Reply With Quote
  #3  
Old 06-20-2013, 02:14 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

Anybody have a chance to look into this and give some good advise please?
Reply With Quote
  #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
  #5  
Old 07-03-2013, 08:34 AM
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

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

Thread Tools
Display Modes


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 02:43 PM.


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