0

I have 2 combo boxes one for Region and One for District (cboRR and cboDD). I am trying to get the cboDD combo box to show only the districts that are in the selected Region. What I have tried so far is adding in an AfterUpdate to the cboRR with a long IF statement with all the RRDD combinations and for the cboDD to have an OnClick Requery. I have tried various combinations of those and nothing so far is working. Are there any thoughts as to why I cannot get this to work?

The if statement for the AfterUpdate is:

Public Sub AfterUpdate()
If cboRR = "03" Then
cboDD = "03" & ";" & "12" & ";" & "13" & ";" & "30" & ";" & "46" & ";" & "55" & ";" & "56" & ";" & "76" & ";" & "86" & ";" & "92" & ";" & "95"
Else
cboDD = " "
End If
If cboRR = "07" Then
cboDD = "07" & ";" & "17" & ";" & "20" & ";" & "27" & ";" & "32" & ";" & "33" & ";" & "36" & ";" & "40" & ";" & "44" & ";" & "45" & ";" & "49" & ";" & "64"
Else
cboDD = " "
End If
If cboRR = "10" Then
cboDD = "17"
Else
cboDD = " "
End If
If cboRR = "12" Then
cboDD = "12" & ";" & "97"
Else
cboDD = " "
End If
If cboRR = "13" Then
cboDD = "02" & ";" & "04" & ";" & "21" & ";" & "41" & ";" & "45" & ";" & "46"
End Sub
user2119980
  • 499
  • 4
  • 12
  • 25

1 Answers1

-1

Create a table that list all possible choices for your first combo box the regions. Then create a second table for your districts with a column that will have all applicable regions separated by the pipe symbol like so |01|02|. Then create a query that looks at the value in your first combo with criteria set to:

Like "*|" & [Forms]![YourForm]![MyFirstComboBox] & "|*"
Mike
  • 144
  • 4
  • This is not a standard solution. – Fionnuala Apr 04 '14 at 22:12
  • I am trying to make this as simple as possible, the less activity going on in the background the better. This is going to be used by people other than me. So the less there is to go wrong the easier their lives will be. I do appreciate the input and will look into this method. – user2119980 Apr 07 '14 at 13:07