G
Guest
Programmatically determining selected index of combobox produces null erro
Below is one example of what I tried. Subsequently I update the database in the submitupdate button. My scheme is adapted from ADO.NET Core Reference Chapters 13 and 11
If I click the combobox to the same values already there, it works fine. That's not such a burden but it seems to me I ought to be able to determine the selected index programmatically
Any help would be appreciated
polynomial5
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Clic
cm.EndCurrentEdit(
If cboPubFreq.SelectedIndex = -1 The
cboPubFreq.SelectedIndex =
ElseIf cboPubFreq.SelectedIndex = cm.Count - 1 The
cboPubFreq.SelectedIndex =
Els
cboPubFreq.SelectedIndex = cboPubFreq.SelectedIndex +
End I
If cboPublicationType.SelectedIndex = -1 The
cboPublicationType.SelectedIndex =
Els
cboPublicationType.SelectedIndex = cboPublicationType.SelectedInde
End I
If cboContentRights.SelectedIndex = -1 The
cboContentRights.SelectedIndex =
Els
cboContentRights.SelectedIndex = cboContentRights.SelectedInde
End I
If cboPointOfView.SelectedIndex = -1 The
cboPointOfView.SelectedIndex =
Els
cboPointOfView.SelectedIndex =
End I
SetEditMode(False
End Sub
Below is one example of what I tried. Subsequently I update the database in the submitupdate button. My scheme is adapted from ADO.NET Core Reference Chapters 13 and 11
If I click the combobox to the same values already there, it works fine. That's not such a burden but it seems to me I ought to be able to determine the selected index programmatically
Any help would be appreciated
polynomial5
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Clic
cm.EndCurrentEdit(
If cboPubFreq.SelectedIndex = -1 The
cboPubFreq.SelectedIndex =
ElseIf cboPubFreq.SelectedIndex = cm.Count - 1 The
cboPubFreq.SelectedIndex =
Els
cboPubFreq.SelectedIndex = cboPubFreq.SelectedIndex +
End I
If cboPublicationType.SelectedIndex = -1 The
cboPublicationType.SelectedIndex =
Els
cboPublicationType.SelectedIndex = cboPublicationType.SelectedInde
End I
If cboContentRights.SelectedIndex = -1 The
cboContentRights.SelectedIndex =
Els
cboContentRights.SelectedIndex = cboContentRights.SelectedInde
End I
If cboPointOfView.SelectedIndex = -1 The
cboPointOfView.SelectedIndex =
Els
cboPointOfView.SelectedIndex =
End I
SetEditMode(False
End Sub