Designing Outlook form

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
Jay CaraxAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tony GiangrecoCommented:
This link takes you through the entire process. Hope it helps!

http://www.slipstick.com/developer/designing-custom-forms/
Jamie McKillopIT ManagerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jay CaraxAuthor Commented:
Thanks - I will take a look at these now.
Jamie McKillopIT ManagerCommented:
I just noticed a mistake. insert the line:

Case "Ground:

before:

#If Floor equals "Ground"
Jay CaraxAuthor Commented:
Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.