Link to home
Start Free TrialLog in
Avatar of concep86
concep86

asked on

Outlook Custom Form Country/State/county drop down...

I have a custom form created in outlook 2007.  

I have the following fields...  Country(select), State(Text), County(Text).
I would like them to be all select(drop downs)...

What I need to be able to do is allow the user to select country.  Based on the selection... the state field populates... and based on the state selection, the county field then populates...

It is too easy for misspelling county or state...

I have all the country/state/county mappings... in a file...  

Thanks
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, concep86.

Not too difficult, although you will need to write some code to accomplish this.  Here's what you need to do.

1.  Edit the custom form and add three comboboxes, one for each field.

2.  Write code that handles the loading of the state and county boxes.  Something like this
Sub Item_CustomPropertyChange(strName)
    Select Case strName
        Case "COUNTRY_FIELD_NAME"
            'Code for loading the state field'
        Case "STATE_FIELD_NAME"
            'Code for loading the county field'
    End Select
End Sub

Open in new window

Avatar of concep86
concep86

ASKER

Sorry this is my first outlook form... so I need a little more guidance....

Lets say i have this data...

Country = US, CANADA, MEXICO
 States = NC, NJ, ALBERTA, QUEBEC, HIDALGO, DURANGO
County = county 1, county 2, county 3, county 4, county 5, county county 6
Just 2 states for each country... and 1 counties per state...just to make this simple for me to follow.

What would be the code for loading the comboboxes... and where does the code above go???

Yep, new to this stuff.

Thanks, your assistance is greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Awesome... Thanks You Rock!
Thanks and you're welcome!
BlueDevilFan,

The forms are working beautifully in the forms designer... but not when I try to use the form....

Thanks Again...
How are they not working?
When you select the Country... the state field does not populate...

It does in designer, when I click "run this form"... But when I access the form from the new /choose form menu...

I can populate the country... the the state remins blank
Just tested it here and it works fine.  Are you sure you matched the page, control, and property names up correctly?  Did you publish the form to a library or folder?  How are you creating a new item based on the form?
:-)  Sorry... was saving form but not publishing it...  

Published form... and it works like a charm...

Thanks again...
No problem.
I had a follow up question...

I changed the county field to a listbox... I need to be able to select multiple counties per state....

I can select a country, state and multiple counties... but when I click out of the county field... the selections I made are no longer highlighted.... nor is it submitted...

Your assistance is greatly appreciated...

I tried to create new question to give you credit for helping... but went un answered so I am back here...

Thansk