![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have two forms, both with text boxes, labels and command buttons on them.
I need to be able to click the command button on Form2 and access the control values in Form1 and place them into the controls on Form2. I just don't know how to access a second form from the first one. Pretty basic, I know! If you have any input, please let me know! |
Ads |
#2
|
|||
|
|||
![]()
You cannot click a button in a form using code since the
MSForms.CommandButton control doesn't expose a Click or Execute or equivalent method. To get to another open item you iterate the Inspectors collection. Every open item is in that collection. To identify the item you can check the MessageClass, Subject or other property that you know will be unique. Once you have the item's Inspector you use its ModifiedFormPages collection to get the page (tab) and then use the page's Controls collection to access specific controls: ' oInsp is the Inspector Set oPage = oInsp.ModifiedFormPages.Item("myFormPageName") Set oTextBox1 = oPage.Controls.Item("TextBox1Name") -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "cmonroe21" u48566@uwe wrote in message news:8f9b010382c0e@uwe... I have two forms, both with text boxes, labels and command buttons on them. I need to be able to click the command button on Form2 and access the control values in Form1 and place them into the controls on Form2. I just don't know how to access a second form from the first one. Pretty basic, I know! If you have any input, please let me know! |
#3
|
|||
|
|||
![]()
Thanks so much! I was sort of using this convention by:
Set objPage = Item.GetInspector.ModifiedFormPages("Message") Set objControl = objPage.Controls("TextBox1") MyValue - objControl.Value But for some reason it wasn't working ![]() script editor and opt to use Vba in VB editor. Instead of messing with swapping between the Message and P.2 tabs, and the compose and read messages, I just created a form with the controls to inquire the data I need, then a button that sends a newly created email item that contains the data. Thanks so much for your help... the iterating between Inspectors is a new concept for me. You would just create a loop to check the specific property of each iteration? Veddy Inteddesting.... Ken Slovak - [MVP - Outlook] wrote: You cannot click a button in a form using code since the MSForms.CommandButton control doesn't expose a Click or Execute or equivalent method. To get to another open item you iterate the Inspectors collection. Every open item is in that collection. To identify the item you can check the MessageClass, Subject or other property that you know will be unique. Once you have the item's Inspector you use its ModifiedFormPages collection to get the page (tab) and then use the page's Controls collection to access specific controls: ' oInsp is the Inspector Set oPage = oInsp.ModifiedFormPages.Item("myFormPageName") Set oTextBox1 = oPage.Controls.Item("TextBox1Name") I have two forms, both with text boxes, labels and command buttons on them. I need to be able to click the command button on Form2 and access the [quoted text clipped - 3 lines] how to access a second form from the first one. Pretty basic, I know! If you have any input, please let me know! -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...g-vba/200901/1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Control the values in thread of the Read Page | Sandi V | Outlook - Using Forms | 3 | December 3rd 08 03:05 PM |
multi select control not in my control toolbox | GolfGal | Outlook - Using Forms | 4 | August 13th 07 09:26 PM |
Outlook View Control embedded in custom control | [email protected] | Outlook - General Queries | 1 | November 8th 06 11:41 AM |
Outlook View Control embedded in custom control | [email protected] | Outlook - Using Forms | 1 | November 8th 06 11:41 AM |
parameter values not valid when accessing calendar | Suedra | Outlook - Calandaring | 3 | March 5th 06 06:07 PM |