donnex777
New member
Good day
I am a newbie in vb.net and I am trying to create a database program. Moving on to my inquiry, I am having trouble getting the value of a combobox1 from formA and passing it on two form b. All help will be very much appreciated.
my code looks like this:
In addition I would also like to pass to the dgv of wholesale form the additional information. Which also to my demise is not happening every time button 1 is triggered. the continuation of the code is as follow:
Please help. my code use to work in vb 2008 and i dont know why it is not working in vb2010. id really appreciate any help
I am a newbie in vb.net and I am trying to create a database program. Moving on to my inquiry, I am having trouble getting the value of a combobox1 from formA and passing it on two form b. All help will be very much appreciated.
my code looks like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Dim w As New Wholesale 'w.WholesaleTA.Insert(w.ComboBox1.Text,w.DateTimePicker1.Text,w.TextBox3.Text) Dim name As String name = w.ComboBox1.Text Dim day As Date day = w.DateTimePicker1.Textevery time I run this code variable name and day always appears empty even though there is something written in combobox1 and datetimepicker1 in wholesale tables
In addition I would also like to pass to the dgv of wholesale form the additional information. Which also to my demise is not happening every time button 1 is triggered. the continuation of the code is as follow:
Dim subtotal As Double subtotal = TextBox1.Text * TextBox3.Text TextBox4.Text = FormatNumber(subtotal, 2, , , TriState.True) Dim pt = ProductTA.GetDataByproductname(ComboBox1.Text) Dim p As COLONELSACCESS.CODS.productdatabaseRow = pt.Rows(0) Dim lt = LotnoTA.GetDataByproductid(p.productid) Dim l As COLONELSACCESS.CODS.lotnoRow = lt.Rows(0) w.Dgv.Rows.Add(p.productid, l.lotnumber, p.productname, TextBox1.Text, TextBox3.Text, TextBox4.Text, l.deldate, l.expdate, l.supplier, l.discount) Dim i As Integer For i = 0 To w.Dgv.Rows.Count - 1 Dim dgvsubtotal As Double dgvsubtotal += w.Dgv.Rows(i).Cells(5).Value w.TextBox3.Text = FormatNumber(dgvsubtotal, 2, , , TriState.True) Next Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Information Or MsgBoxStyle.OkOnly) End Try End Sub
Please help. my code use to work in vb 2008 and i dont know why it is not working in vb2010. id really appreciate any help