S
Sophie
This is a variation of a question that Marshall Barton provided a good
solution for a few days ago. I just can't seem to get this perfect.
I now have 3 unbound comboboxes (cbxReg and cbxArea and cbxDistrict) on my
form. cbxArea gets its RowSource from the AfterUpdate event of cbxReg, and
cbxDistrict gets its RowSource from the AfterUpdate event of cbxArea. For
example, here is cbxReg's AfterUpdate code.
Me!cbxArea.RowSource = "SELECT qryData.AreaID,qryData.AreaName
FROM qryData WHERE RegID= " & Me!cbxReg.Column(0) & ";"
Me!cbxReg.Value = [cbxReg].[ItemData](0)
Me.Requery
Me!cbxArea.SetFocus
Similar code in cbxArea provides the RowSource for cbxDistrict.
Here is my difficulty. When the form opens and I select a Region, the Area
combo shows its 1st 'where-matching' value properly. But I also want the
District combo to show its first 'where-matching' value as well. As it is
now, I first have to update cbxArea before cbxDistrict shows the appropriate
values. How do I get the 3rd combobox to properly update once I've selected
a value from the 1st?
solution for a few days ago. I just can't seem to get this perfect.
I now have 3 unbound comboboxes (cbxReg and cbxArea and cbxDistrict) on my
form. cbxArea gets its RowSource from the AfterUpdate event of cbxReg, and
cbxDistrict gets its RowSource from the AfterUpdate event of cbxArea. For
example, here is cbxReg's AfterUpdate code.
Me!cbxArea.RowSource = "SELECT qryData.AreaID,qryData.AreaName
FROM qryData WHERE RegID= " & Me!cbxReg.Column(0) & ";"
Me!cbxReg.Value = [cbxReg].[ItemData](0)
Me.Requery
Me!cbxArea.SetFocus
Similar code in cbxArea provides the RowSource for cbxDistrict.
Here is my difficulty. When the form opens and I select a Region, the Area
combo shows its 1st 'where-matching' value properly. But I also want the
District combo to show its first 'where-matching' value as well. As it is
now, I first have to update cbxArea before cbxDistrict shows the appropriate
values. How do I get the 3rd combobox to properly update once I've selected
a value from the 1st?