Click to See Complete Forum and Search --> : Textbox populate


dr223
April 26th, 2010, 05:54 AM
Hi,

I have a textbox called txtProjname , I also have a combobox called cmbactiveproj. cmbactiveproj is populated from a dataset called activeprojects. This shows a dropdown list of all the projects.

The dataset which loads the combobox is read from the dataset shown below;

Me.ActiveprojectsTableAdapter.FillBy(Me.Dsactiveprojects.activeprojects)

Now, I want to populate txtProjname with the project when a project is clicked at the cmbactiveproj. So I have the folowing code;


Private Sub cmbactiveproj_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbactiveproj.Click

txtProjname.Clear()
txtProjname.Text = cmbactiveproj.Text


End Sub

The above code reads the previous clicked project and populates it to txtProjname not the current project. Any help please..
Thanks

DataMiser
April 26th, 2010, 07:36 AM
Have you tried using the selecteditem property instead?