Hello,
I actually have a form "Commande" and another form and " Détails de commande"
1-the form " Commande " contains additional update buttons, and another button called " Button15 "
2- the form “Détails de commande” contains TextBox1 and TextBox2 and combobox1(for list of product) and textbox5( order quantity)
in the source code as follows:
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
Dim Details_commandes As New Details_commandes
Details_commandes.TextBox1.Text = TextBox8.Text
Details_commandes.TextBox2.Text = DateTimePicker1.Text
Details_commandes.Show()
End Sub
the button " Button15 " used to take the values of “N°Commande” and that of the “Date de commande” from the form “Commande” and displays them in the form “Détails de commande”.
The problem that when I fill the information of the form ”Commande” (N°Commande,Date de commande, .....) and I click on the “ bouton15” to show the form “Détails de commande” , the combobox1 is empty, but when I reruning the both form I can see the combobox1 with information and I can fill the remaining information for the form “Détails de commande”
[EDITED]
This the code to fill combobox1 in the form "detail de commande":
Private Sub DetailsCommandesF_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim dr As OleDbDataReader
CN.Open()
cmd.Connection = CN
cmd.CommandText = "select Reference from Produits "
dr = cmd.ExecuteReader
Remplir_Liste_Detail_CommandesAF()
While dr.Read
ComboBox1.Items.Add(dr.GetValue(0))
End While
CN.Close()
Catch ex As Exception
End Try
End Sub