1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

One combobox link to TWO comboxes

Discussion in 'Business Applications' started by TTOO, Jan 21, 2013.

Thread Status:
Not open for further replies.
  1. TTOO

    TTOO Thread Starter

    Joined:
    Jan 20, 2013
    Messages:
    1
    Hello everybody,

    It is my first request on this forum, I already found several answers for my ACCESS 2010 issues but now I have another one.
    I would like to link one combobox to TWO comboboxes:
    - Combobox to link: cboArea
    - to TWO comboxes:
    cboSubzone
    cbo Floor

    cboSubzone is already linked to another combobox cboZone
    So here's the order of the cascading comboboxes
    Zone - SubZone - Floor Level - Area

    I have the beginning of a code but don't know how to finish it...any thoughts please? :confused:

    Private Sub cboZone_AfterUpdate()
    On Error Resume Next
    Select Case cboZone.Value
    Case "Zone A"
    cboSubzone.RowSource = "2-1ZoneASubZones"
    Case "Zone B"
    cboSubzone.RowSource = "2-2ZoneBSubZones"
    Case "Zone C"
    cboSubzone.RowSource = "2-3ZoneCSubZones"
    Case "Zone D"
    cboSubzone.RowSource = "2-4ZoneDSubZones"
    Case "Zone E"
    cboSubzone.RowSource = "2-5ZoneESubZones"
    Case "Zone F"
    cboSubzone.RowSource = "2-6ZoneFSubZones"
    Case "Zone G"
    cboSubzone.RowSource = "2-7ZoneGSubZones"
    Case "Zone H"
    cboSubzone.RowSource = "2-8ZoneHSubZones"
    Case "Zone I"
    cboSubzone.RowSource = "2-9ZoneISubZones"
    Case "Zone J"
    cboSubzone.RowSource = "2-10ZoneJSubZones"
    End Select
    End Sub

    Private Sub cboSubzone_AfterUpdate()
    On Error Resume Next
    Select Case cboSubzone
    Case "Connectivity"
    cboArea.RowSource = "4-Zone A SubZone 01 Areas"
    Case "Co-Mtg"
    cboArea.RowSource = "4-Zone A SubZone 01 Areas"
    .........................................................
    End Select
    End Sub
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    You are making this quite difficult using VBA code, when it can be done using the row source itself.
    The row Source produces an SQL Query which can be filtered using the criteria row.
    The criteria uses the format
    forms![formname]![comboname]
    I have posted numerous versions of this in the past.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1086216

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice