Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2013, 11:19 AM
gmaxey gmaxey is offline Contact details entered based on multiple drop down selections Windows 7 32bit Contact details entered based on multiple drop down selections Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default


I agree with Paul, but bored I thought I would provide some sample code. First you don't say what type of form or what type of control. This assumes a UserForm with two listbox controls. You basically have to populate the first with the divisions and then populate the second with branches using the change event of the first:

Code:
Private Sub lstDiv_Change()
If lstDiv.ListIndex <> -1 Then
  With lstBranch
    .Enabled = True
    .Clear
    Select Case lstDiv.Value
      Case "Operations"
        .AddItem "QM"
        .AddItem "ET"
      Case "Engineering"
        .AddItem "A"
        .AddItem "M"
        .AddItem "E"
      Case "Medical"
        .AddItem "X"
        .AddItem "Y"
        .AddItem "Z"
      Case "Dental"
        .AddItem "X"
        .AddItem "Y"
        .AddItem "Z"
      Case "Weapons"
        .AddItem "TM"
        .AddItem "FTB"
        .AddItem "MT"
    End Select
  End With
Else
  With lstBranch
    .Clear
    .Enabled = False
    .Clear
  End With
End If
  
End Sub
Private Sub UserForm_Initialize()
With Me
  With .lstDiv
    .AddItem "Operations"
    .AddItem "Engineering"
    .AddItem "Medical"
    .AddItem "Dental"
    .AddItem "Weapons"
  End With
  .lstBranch.Enabled = False
End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Contact details entered based on multiple drop down selections Dynamically changing drop-down list based on selection? (Word Form) laurarem Word 1 02-21-2013 10:17 PM
ppt slides with adjustable graphs based on drop down psrs0810 PowerPoint 0 01-30-2013 07:10 AM
Outlook, Excel or Access to mange contact details? davesp Outlook 0 01-24-2013 09:47 AM
Hide contact details AndyKC Outlook 0 01-25-2010 11:00 PM
Entering Contact details GemmaD Outlook 0 12-18-2008 06:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft