A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Follow up: Make a combo box dependant on another



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 2nd 09, 02:46 PM posted to microsoft.public.outlook.program_forms
Amy Brooks
external usenet poster
 
Posts: 16
Default Follow up: Make a combo box dependant on another

Hi Sue,

Regarding the previous question, could I add more code to have a third combo
box relate to the second?

Thanks,
Amy
Ads
  #2  
Old June 2nd 09, 02:54 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default Follow up: Make a combo box dependant on another

Again, that's going to depend on whether the 2nd combo box is bound or not.
If it is, you add another Case block to the CustomPropertyChange event
handler to handle the change in that property. If not, you use the control's
Click event. See the previously suggested article.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Amy Brooks" wrote in message
...
Hi Sue,

Regarding the previous question, could I add more code to have a third
combo
box relate to the second?

Thanks,
Amy



  #3  
Old June 2nd 09, 03:50 PM posted to microsoft.public.outlook.program_forms
Amy Brooks
external usenet poster
 
Posts: 16
Default Follow up: Make a combo box dependant on another

Bound is when it saves the selections when closed?
If so, I think they are bound.
If they are, how would I go about adding another case block? There are more
values now, is that still the way to go?

"Sue Mosher [MVP]" wrote:

Again, that's going to depend on whether the 2nd combo box is bound or not.
If it is, you add another Case block to the CustomPropertyChange event
handler to handle the change in that property. If not, you use the control's
Click event. See the previously suggested article.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Amy Brooks" wrote in message
...
Hi Sue,

Regarding the previous question, could I add more code to have a third
combo
box relate to the second?

Thanks,
Amy




  #4  
Old June 2nd 09, 04:11 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default Follow up: Make a combo box dependant on another

Yes, that's one of the characteristics of bound controls.

The second Case block to handle a second property's value changes would go
right after the first, as in the example at
http://www.outlookcode.com/article.aspx?ID=38.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Amy Brooks" wrote in message
...
Bound is when it saves the selections when closed?
If so, I think they are bound.
If they are, how would I go about adding another case block? There are
more
values now, is that still the way to go?

"Sue Mosher [MVP]" wrote:

Again, that's going to depend on whether the 2nd combo box is bound or
not.
If it is, you add another Case block to the CustomPropertyChange event
handler to handle the change in that property. If not, you use the
control's
Click event. See the previously suggested article.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Amy Brooks" wrote in message
...
Hi Sue,

Regarding the previous question, could I add more code to have a third
combo
box relate to the second?

Thanks,
Amy






  #5  
Old June 2nd 09, 05:04 PM posted to microsoft.public.outlook.program_forms
Amy Brooks
external usenet poster
 
Posts: 16
Default Follow up: Make a combo box dependant on another

So maybe something like:

-----------------------------------------------------------------------------------------------
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "Division"
Call SetSubDivision
Case "SubDivision"
Call SetThirdBox
End Select
End Sub
_________________________________________________

Sub SetSubDivision
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("General")
Set SubDivision = objPage.Controls("cboSubDivision")
Select Case Item.UserProperties("Division")
Case "Ambulance"
SubDivision.List = Split("Air,NHS,Private,Vehicle Builder,Voluntary",",")
Case "Export"
SubDivision.List = Split("Distributor,End User,Ferno Group",",")
Case "Hospital"
SubDivision.List = Split("Distributor,MOD,NHS,Private",",")
Case "Industry"
SubDivision.List = Split("N/A",",")
Case "Mortuary"
SubDivision.List = Split("Distributor,Funeral Director",",")
End Select
End Sub
_________________________________________________

Sub SetThirdBox
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("General")
Set ThirdBox = objPage.Controls("cboThirdBox")
Select Case Item.UserProperties("SubDivision")
Case "NHS"
ThirdBox.List = Split("Option A, Option B",",")
Case "Private"
ThirdBox.List = Split("Option C, Option D",",")
(etc.....)
End Select
End Sub
-----------------------------------------------------------------------------------------------


"Sue Mosher [MVP]" wrote:

Yes, that's one of the characteristics of bound controls.

The second Case block to handle a second property's value changes would go
right after the first, as in the example at
http://www.outlookcode.com/article.aspx?ID=38.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Amy Brooks" wrote in message
...
Bound is when it saves the selections when closed?
If so, I think they are bound.
If they are, how would I go about adding another case block? There are
more
values now, is that still the way to go?

"Sue Mosher [MVP]" wrote:

Again, that's going to depend on whether the 2nd combo box is bound or
not.
If it is, you add another Case block to the CustomPropertyChange event
handler to handle the change in that property. If not, you use the
control's
Click event. See the previously suggested article.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Amy Brooks" wrote in message
...
Hi Sue,

Regarding the previous question, could I add more code to have a third
combo
box relate to the second?

Thanks,
Amy






  #6  
Old June 2nd 09, 05:38 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default Follow up: Make a combo box dependant on another

Exactly. That's how you build on what you've learned!
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Amy Brooks" wrote in message
...
So maybe something like:

-----------------------------------------------------------------------------------------------
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "Division"
Call SetSubDivision
Case "SubDivision"
Call SetThirdBox
End Select
End Sub
_________________________________________________

Sub SetSubDivision
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("General")
Set SubDivision = objPage.Controls("cboSubDivision")
Select Case Item.UserProperties("Division")
Case "Ambulance"
SubDivision.List = Split("Air,NHS,Private,Vehicle Builder,Voluntary",",")
Case "Export"
SubDivision.List = Split("Distributor,End User,Ferno Group",",")
Case "Hospital"
SubDivision.List = Split("Distributor,MOD,NHS,Private",",")
Case "Industry"
SubDivision.List = Split("N/A",",")
Case "Mortuary"
SubDivision.List = Split("Distributor,Funeral Director",",")
End Select
End Sub
_________________________________________________

Sub SetThirdBox
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("General")
Set ThirdBox = objPage.Controls("cboThirdBox")
Select Case Item.UserProperties("SubDivision")
Case "NHS"
ThirdBox.List = Split("Option A, Option B",",")
Case "Private"
ThirdBox.List = Split("Option C, Option D",",")
(etc.....)
End Select
End Sub
-----------------------------------------------------------------------------------------------


"Sue Mosher [MVP]" wrote:

Yes, that's one of the characteristics of bound controls.

The second Case block to handle a second property's value changes would
go
right after the first, as in the example at
http://www.outlookcode.com/article.aspx?ID=38.



"Amy Brooks" wrote in message
...
Bound is when it saves the selections when closed?
If so, I think they are bound.
If they are, how would I go about adding another case block? There are
more
values now, is that still the way to go?

"Sue Mosher [MVP]" wrote:

Again, that's going to depend on whether the 2nd combo box is bound or
not.
If it is, you add another Case block to the CustomPropertyChange event
handler to handle the change in that property. If not, you use the
control's
Click event. See the previously suggested article.

"Amy Brooks" wrote in message
...
Hi Sue,

Regarding the previous question, could I add more code to have a
third
combo
box relate to the second?



  #7  
Old June 2nd 09, 06:31 PM posted to microsoft.public.outlook.program_forms
Amy Brooks
external usenet poster
 
Posts: 16
Default Follow up: Make a combo box dependant on another

Great stuff, thanks for all your help Sue!

"Sue Mosher [MVP]" wrote:

Exactly. That's how you build on what you've learned!
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Amy Brooks" wrote in message
...
So maybe something like:

-----------------------------------------------------------------------------------------------
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "Division"
Call SetSubDivision
Case "SubDivision"
Call SetThirdBox
End Select
End Sub
_________________________________________________

Sub SetSubDivision
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("General")
Set SubDivision = objPage.Controls("cboSubDivision")
Select Case Item.UserProperties("Division")
Case "Ambulance"
SubDivision.List = Split("Air,NHS,Private,Vehicle Builder,Voluntary",",")
Case "Export"
SubDivision.List = Split("Distributor,End User,Ferno Group",",")
Case "Hospital"
SubDivision.List = Split("Distributor,MOD,NHS,Private",",")
Case "Industry"
SubDivision.List = Split("N/A",",")
Case "Mortuary"
SubDivision.List = Split("Distributor,Funeral Director",",")
End Select
End Sub
_________________________________________________

Sub SetThirdBox
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("General")
Set ThirdBox = objPage.Controls("cboThirdBox")
Select Case Item.UserProperties("SubDivision")
Case "NHS"
ThirdBox.List = Split("Option A, Option B",",")
Case "Private"
ThirdBox.List = Split("Option C, Option D",",")
(etc.....)
End Select
End Sub
-----------------------------------------------------------------------------------------------


"Sue Mosher [MVP]" wrote:

Yes, that's one of the characteristics of bound controls.

The second Case block to handle a second property's value changes would
go
right after the first, as in the example at
http://www.outlookcode.com/article.aspx?ID=38.



"Amy Brooks" wrote in message
...
Bound is when it saves the selections when closed?
If so, I think they are bound.
If they are, how would I go about adding another case block? There are
more
values now, is that still the way to go?

"Sue Mosher [MVP]" wrote:

Again, that's going to depend on whether the 2nd combo box is bound or
not.
If it is, you add another Case block to the CustomPropertyChange event
handler to handle the change in that property. If not, you use the
control's
Click event. See the previously suggested article.

"Amy Brooks" wrote in message
...
Hi Sue,

Regarding the previous question, could I add more code to have a
third
combo
box relate to the second?




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a combo box dependant on another Amy Brooks Outlook - Using Forms 5 June 2nd 09 02:52 PM
Make a combo box dependant on another Amy Brooks Outlook and VBA 0 June 2nd 09 12:02 PM
Outlook 2003 - Move E-mail to Folder Using Rules (Dependant on Sender& When Received) [email protected] Outlook - General Queries 5 January 2nd 08 10:48 PM
Combo box skar3000 Outlook - Using Forms 3 June 15th 07 01:14 PM
Auto insert a value dependant on the previous fields content Brizey112 Outlook - Using Forms 1 February 23rd 06 06:22 PM


All times are GMT +1. The time now is 04:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.