D
Darhl Thomason
I have a combo box control (cboDistrict) on my form that does not always
show the data stored in the current record, and sometimes it does. I can't
figure out why it sometimes shows and sometimes doesn't. If I open the
combo box, the correct value is highlighted in the list, and the correct
value is entered in that record's field in the db table.
cboDistrict is set to populate based on the value of another combo box
(cboRegion), the code behind cboDistrict is:
Private Sub cboDistrict_GotFocus()
strSQL2 = "SELECT DistrictID, DistrictName " _
& " FROM tblDistrict WHERE RegionID = " & Me.cboRegion _
& " ORDER BY DistrictName"
Me.cboDistrict.RowSource = strSQL2
End Sub
I'm thinking that it may be because the combo box is set to update when it
gets focus, but it seems like that shouldn't matter if there is a value
stored in that record. The combo box population is really only if you want
to change it.
Any ideas/help would be appreciated.
Thanks,
Darhl
show the data stored in the current record, and sometimes it does. I can't
figure out why it sometimes shows and sometimes doesn't. If I open the
combo box, the correct value is highlighted in the list, and the correct
value is entered in that record's field in the db table.
cboDistrict is set to populate based on the value of another combo box
(cboRegion), the code behind cboDistrict is:
Private Sub cboDistrict_GotFocus()
strSQL2 = "SELECT DistrictID, DistrictName " _
& " FROM tblDistrict WHERE RegionID = " & Me.cboRegion _
& " ORDER BY DistrictName"
Me.cboDistrict.RowSource = strSQL2
End Sub
I'm thinking that it may be because the combo box is set to update when it
gets focus, but it seems like that shouldn't matter if there is a value
stored in that record. The combo box population is really only if you want
to change it.
Any ideas/help would be appreciated.
Thanks,
Darhl