MartinCroft
Programmer
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
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