I've linked an access database to my form. I have 1 table , 2 rows 1 = Researchtype short text 2 = Researchdetails (long text)
In my combobox1 i've binded my researchtype row so i can choose a type of research.
Question now: how can i bind the details data to the richtextbox below it in order to show the research data as soon as i choose a research type?
I've tried if else combos, try catch combos, i'm thinking i'm actually overthinking the issue here.
What would be the easiest way to "select from dropdown" and show the result in textbox. I'm a vb.net beginner
Public Class Onderzoeken
Private Sub Onderzoeken_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PatientenDatabaseDataSetX.tbl_OnderzoeksTypes' table. You can move, or remove it, as needed.
Me.Tbl_OnderzoeksTypesTableAdapter.Fill(Me.PatientenDatabaseDataSetX.tbl_OnderzoeksTypes)
End Sub
Private Sub cboxOnderzoek_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboxOnderzoek.SelectedIndexChanged
If cboxOnderzoek.SelectedItem = Nothing Then
cboxOnderzoek.Text = ""
Else
rtbBeschrijvingOnderzoek.Text = CStr(CType(cboxOnderzoek.SelectedItem, DataRowView)("OZ_Onderzoeksbeschrijving"))
End If
End Sub
End Class
I added the entire code of that page now , it's not much, but as stated: I added the binding source and displaymember "researchtype" to the combobox. So when i start the form, i can choose a type of research. Now i need to show the description of the research in the richtextbox

In the
Form.Load...I have a function that returns a
DataTablethat contains columns calledNameandType. I bind the ComboBox to theDataTableand set theDisplayMemberto"Name". Each Item in the ComboBox contains the entireDataRowView. I set theTextBoxto the first row (dt(0)("Type"))Typecolumn value so the correct information will be displayed for the initial selection.I put the code to change the textbox display in
ComboBox1.SelectionChangeCommittedbecause the other change events will produce a NRE since.SelectedItemhas not yet been set when the form loads. The commited event will only occur when the user makes a selection.First, cast the
SelectedItemto its underlying type,DataRowView. Then you want the value of theTypecolumn. This value is assigned to the text property of the textbox.Just substitute
ResearchtypeforNameandResearchdetailsforType.