G
Guest
I have two combo boxes that are based on queries. The queries are sorted by
school name for one box and school code for the other. Both combo boxes are
bound and data selected from one box will update the other. This process
works fine. There are four other text boxes that are updated by this query.
The problem I'm having is, some schools have identical names. As you type
the name in the combo box, the section of identical names will move to the
top. If I select say the third name in the group, all the boxes will update
correctly. However, if you change the name to another identical name, say
the fourth one in the group, the combo boxes will update correctly, but the
data in the text boxes will be for the first one in the group. Why is this
happening and how can I fix it?
Here is the code for one of the combos
Private Sub cboSCHOOL_NAME_AfterUpdate()
Me![SCHOOL_CODE].Value = cboSCHOOL_NAME.Column(1)
Me.[SNAME].Value = cboSCHOOL_NAME.Column(0)
Me.[LOW_INCOME].Value = cboSCHOOL_NAME.Column(4)
Me![LOW_PERF_20].Value = cboSCHOOL_NAME.Column(5)
Me![LOW_PERF_50].Value = cboSCHOOL_NAME.Column(6)
Me![RURAL_AREA].Value = cboSCHOOL_NAME.Column(7)
Me![EMRG_PERMIT].Value = cboSCHOOL_NAME.Column(8)
Me![COUNTY_NAME].Value = cboSCHOOL_NAME.Column(2)
Me![DISTRICT_NAME].Value = cboSCHOOL_NAME.Column(3)
Me.REFRESH
End Sub
school name for one box and school code for the other. Both combo boxes are
bound and data selected from one box will update the other. This process
works fine. There are four other text boxes that are updated by this query.
The problem I'm having is, some schools have identical names. As you type
the name in the combo box, the section of identical names will move to the
top. If I select say the third name in the group, all the boxes will update
correctly. However, if you change the name to another identical name, say
the fourth one in the group, the combo boxes will update correctly, but the
data in the text boxes will be for the first one in the group. Why is this
happening and how can I fix it?
Here is the code for one of the combos
Private Sub cboSCHOOL_NAME_AfterUpdate()
Me![SCHOOL_CODE].Value = cboSCHOOL_NAME.Column(1)
Me.[SNAME].Value = cboSCHOOL_NAME.Column(0)
Me.[LOW_INCOME].Value = cboSCHOOL_NAME.Column(4)
Me![LOW_PERF_20].Value = cboSCHOOL_NAME.Column(5)
Me![LOW_PERF_50].Value = cboSCHOOL_NAME.Column(6)
Me![RURAL_AREA].Value = cboSCHOOL_NAME.Column(7)
Me![EMRG_PERMIT].Value = cboSCHOOL_NAME.Column(8)
Me![COUNTY_NAME].Value = cboSCHOOL_NAME.Column(2)
Me![DISTRICT_NAME].Value = cboSCHOOL_NAME.Column(3)
Me.REFRESH
End Sub