PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Form Programming Combo Box Relation

Reply

Combo Box Relation

 
Thread Tools Rate Thread
Old 01-07-2003, 08:59 PM   #1
David Bowman
Guest
 
Posts: n/a
Default Combo Box Relation


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.
>
>
>
>
>.
>

  Reply With Quote
Old 01-07-2003, 09:29 PM   #2
Sue Mosher [MVP]
Guest
 
Posts: n/a
Default Re: Combo Box Relation

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.


  Reply With Quote
Old 02-07-2003, 02:19 PM   #3
David Bowman
Guest
 
Posts: n/a
Default Re: Combo Box Relation

"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.

  Reply With Quote
Old 02-07-2003, 03:01 PM   #4
Sue Mosher [MVP]
Guest
 
Posts: n/a
Default Re: Combo Box Relation

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.
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off