Designing Outlook form

Jay Carax
Jay Carax used Ask the Experts™
on
Hello,

I have two drop down menus, one called 'Floor' and the other called 'Area'. I want it so that when I select a type of floor, it will dynamically update the area drop down with relevant items. Can someone please show me how to link them?

An example would be

Floor
Values =   Basement, Ground

 
If Floor = Basement    

then values in Area should only display:  Bike Store, Kitchen, Boiler Room

If Floor = Ground
then values in Area should only display: Reception, Lift Lobby, Library

Please see attachment for a basic visual.

Thanks
image001--1-.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
This link takes you through the entire process. Hope it helps!

http://www.slipstick.com/developer/designing-custom-forms/
Hello,

In the code, remove the lines that start with # as these are my comments explaining the code.

#You need to first create a subroutine to look for changes to values on the form
Sub Item_CustomPropertyChange(ByVal MyProperty)

#Next, you need to specify what page. In your screenshot you are use P.2
Set MyPage = Item.GetInspector.ModifiedFormPages.Add("P.2")

         #Now use the Select Case statement so you can specify which property to look for changes on
         Select Case MyProperty

         #Assuming you named the floor drop-down "floor"
       Case "Floor"
            
                    #If the value of Floor is changed, you want to set the possible values of Area
                    #To do that we use the case statement again
                    Select Case  Item.UserProperties.Find("Floor").Value

                    #If Floor equals "Basement"
                    Case "Basement"
                   
                    #Set the possible values of "Area"
                    MyPage.Controls("Area").PossibleValues = "Bike Store;Kitchen;Boiler Room"

                    #If Floor equals "Ground"
                     MyPage.Controls("Area").PossibleValues = "Reception;Lift Lobby;Library"

                    End Select
          End Select
End Sub

-Jamie

Author

Commented:
Thanks - I will take a look at these now.
I just noticed a mistake. insert the line:

Case "Ground:

before:

#If Floor equals "Ground"

Author

Commented:
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial