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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Make a combo box dependant on another



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

Hi,

I have two combo boxes, one named Division, the other named Sub-Division.
I want to make it so that if you select (for example) Ambulance from the
Division list, the Sub-Division list will only show related items, like NHS,
Private, Air. The lists are as follows:

Ambulance
Air
NHS
Private
Voluntary
Vehicle Builder
Export
Distributor
End User
Group
Hospital
NHS
Private
Distributor
Industry
N/A
Mortuary
Distributor
Funeral Director

The code I have so far is:
------------------------------------------------------------------------------------------------
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "cboDivision"
Call SetSubDivision
End Select
End Sub
_____________________________________________

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

I'm not sure if this is correct, or where to put it.
Help would be appreciated!

Thanks,
Amy
Ads
 




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
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
If then - do while - vlookup combo csjames Outlook and VBA 1 June 28th 07 10:18 PM
Combo box skar3000 Outlook - Using Forms 3 June 15th 07 01:14 PM
Populate a combo box Steffkm Outlook - Using Forms 4 March 14th 06 08:28 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 02:40 AM.


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.