PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Form Programming
Combo Box Relation
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Form Programming
Combo Box Relation
![]() |
Combo Box Relation |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Sure I was trying to do the same thing.
The solution I came up with is not that elegant. <Is that the Microsoft Way?> Setup the first combo box the way you want it. <combo box1> <Command Button> <Combo Box 2> So you choose something in the first list box, Click the Button (Lame I Know) then your second Combo Box gets to have the right stuff in it. I was trying to name the Sub ("Sub ComboBox1_Click()") so the code would actually execute when someone clicked on it <ComboBox1> but It did not seem to work. Can you make the following code execute _every_ time someone touches ComboBox1???????? Please post how... Sub CommandButton1_Click() ' Sets FormPage equal to the page (P.2) Set FormPage = Item.GetInspector.ModifiedFormPages ("P.2") ' Sets Control to a ListBox called ComboBox1. Set Control = FormPage.Controls("ComboBox1") ' Read what they picked as a choice for main category mycat = FormPage.Controls("ComboBox1") ' Real time message for TESTING.... MsgBox "Your varible mycat has the following data in it " & mycat ' Assign values to the new Combobox2 Set Control = FormPage.Controls("ComboBox2") If mycat = "01 GEN REQUIREMENTS" then Control.PossibleValues = "Blue;Green;Red;Yellow" End If If mycat <> "01 GEN REQUIREMENTS" then Control.PossibleValues = "Big;bigger;biggest;****" End If end sub >-----Original Message----- >May someone help me with this please? > >I'm trying to disign in a form, two combo box, which information is >relation. >Ej: > combo1; (1)= months > combo1;(2)=days > > combo2;(1)=january > combo2;(2)=march > combo2;(3)=monday > combo2;(4)=tuesday > > If I chose months in combo1, I want in combo2 display (january, march) >If I chose days en combo 1, I want in combo 2 display (monday, tuesday) >I've been trying to work with custom properties; but with no result.... >May someone gice me a peace of codigo to help me.... > > Thanks. > > Alicia. > > > > >. > |
|
|
|
#2 |
|
Guest
Posts: n/a
|
This should work if the combobox is not bound to an Outlook property. See http://www.slipstick.com/dev/propsyntax.htm#unbound.
-- Sue Mosher, Outlook MVP Outlook and Exchange solutions at http://www.slipstick.com Author of Microsoft Outlook Programming: Jumpstart for Administrators, Power Users, and Developers http://www.slipstick.com/books/jumpstart.htm "David Bowman" <etoll@vipstructures_spamfree.com> wrote in message news:390b01c34013$a0599e90$a401280a@phx.gbl... > > I was trying to name the Sub ("Sub ComboBox1_Click()") so > the code would actually execute when someone clicked on > it <ComboBox1> but It did not seem to work. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
"Should" work? How does one tell if a combobox is/is not
bound to an Outlook Property?? Specificaly a ComboBox. i.e. If I click on Advanced properties of said ComboBox, is there something to look for that indicates if it IS bound or NOT? I cannot tell If it is "bound" to an Outlook property. I used the following code from your site. I run the Form, and change the values in ComboBox1 and I do _not_ get the message. Must I publish the form first for this to work? This is the *only* code I have for the form. I have a dropdown box called ComboBox1, with 3 possible values. Sub ComboBox1_Click() Set objPage = Item.GetInspector.ModifiedFormPages("P.2") Set objControl = objPage.Controls("ComboBox1") MsgBox "The value in the " & objControl.Name & _ "control has changed to " & objControl.Value & "." End Sub >-----Original Message----- >This should work if the combobox is not bound to an Outlook property. See http://www.slipstick.com/dev/propsyntax.htm#unbound. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Right-click the control, bring up its Properties dialog, then look on the Value tab to see whether it's bound to a field.
Yes, you should publish the form. Code does not run on unpublished forms if the Outlook Email Security Update is in place. "David Bowman" <etoll@nospamvipstructures.com> wrote in message news:002701c340a5$01904740$a101280a@phx.gbl... > "Should" work? How does one tell if a combobox is/is not > bound to an Outlook Property?? Specificaly a ComboBox. > i.e. If I click on Advanced properties of said ComboBox, > is there something to look for that indicates if it IS > bound or NOT? I cannot tell If it is "bound" to an > Outlook property. > > I used the following code from your site. I run the > Form, and change the values in ComboBox1 and I do _not_ > get the message. Must I publish the form first for this > to work? This is the *only* code I have for the form. > I have a dropdown box called ComboBox1, with 3 possible > values. > > > Sub ComboBox1_Click() > Set objPage = Item.GetInspector.ModifiedFormPages("P.2") > Set objControl = objPage.Controls("ComboBox1") > MsgBox "The value in the " & objControl.Name & _ > "control has changed to " & objControl.Value & "." > End Sub > > > > >-----Original Message----- > >This should work if the combobox is not bound to an > Outlook property. See > http://www.slipstick.com/dev/propsyntax.htm#unbound. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

