Hello.
In the form load event, I am populating a combobox with items from a database query. I then want to pre-select one of the items. This worked fine under VB6 but I am currently upgrading the code to .Net, and I am getting the error "Operation is not allowed when the object is open". I cannot seem to get by this. Below is my code.
NOTE: I tried using both methods: setting the Text property, as well as the SelectedIndex property (commented), and get the same error.
Thanks in advance,Code:i = 0 Do While Not rs.EOF i = i + 1 cboUsers.Items.Add((rs.Fields(0).Value)) If rs.Fields(0).Value = LANID Then cboUsers.Text = rs.Fields(0).Value 'cboUsers.SelectedIndex = i End If rs.MoveNext() Loop
Paul




Reply With Quote
