One combobox link to TWO comboxes

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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
 

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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Members online

Top