Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox Cannot modifty items collection

Status
Not open for further replies.

MartinCroft

Programmer
Jun 12, 2003
151
GB
Hi

I have 2 combo boxs which are populated from a datasource
and have sevaral text boxes on a couple of forms comboboxA
populates ok and when choosing a value all text boxes relating to that value are populated ( i.e the record move to that record fine)

the 2nd combo box comboBoxB same properties as comboBox A as far as i can see, this is populated from a different Stored procedure and populates fine, however when clicking on the drop down list I get an error Cannot modifty the items Collection when the Datasource propertly is set. I want the datasource propertly set to control the other text boxes.

It works ok for one but not another any ideas where I am going wrong

simplified Code is as follows

Dim ds as dataset

'Create New Data Adapters
daIR = New SqlDataAdapter("sGetIR", cn)
daWO = New SqlDataAdapter("sGetWO", cn)

'Create New DataSet
ds = New DataSet

'Fill the DataSet
daIR.Fill(ds, "IR")
daWO.Fill(ds, "WO")

'databind the control
cbDatRef1.DataSource = ds.Tables(eTb.eIR)
cbDatRef1.DisplayMember = "IRequest"

This works for comboboxA

ComboBoxB Ive tried using the same dataset and chnading the enumeration to the correcttable, this populate the data ok


cbWONO.DataSource = ds.Tables(eTb.eIR)
cbWONO.DisplayMember = "IRequest"

Ive tried creating a new datset and still no joy any idea's
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top