The problem is i want to show a default value on form load in comobo box txt5, user dont need to click on it.
am using goto focus and lost focus to grab data from data base .
I need your suggestion that how to populate a combo txt5 on load like when form load the txt5 combo can show
data from the select query .
Private Sub txt5_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt5.GotFocus Try txt5.Items.Clear() myRead.myfill("Select DETAILACCOUNT from tb_MYCHARTOFACCOUNT") End If Dim rc, lr As Integer lr = myRead.dt.Rows.Count - 1 For rc = 0 To lr txt5.Items.Add(myRead.dt.Rows(rc).Item(0)) Next Catch exc As Exception 'MsgBox(exc.Message) End Try End Sub Private Sub txt5_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt5.LostFocus If txt5.Text <> "" Then fillvcode() End If End Sub
Edited 3 Years Ago by satti