Fill DataGrd with Value From Variabels
Hello everyone,
I've the following code and try to get the value from Variabel tekst1 in Column1 from the DataGrid etc. I really won't work. I use VS 2005
Can somebody help me with it?
Thanks,
E.
Code:
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then
Dim aArtikel, bArtikel, cArtikel, dArtikel As String
Dim r, i As Integer
Dim Optel, Optel2 As String
Dim tekst1, tekst2, tekst3, tekst4 As String
Dim toevoeg
aArtikel = Me.txtBarCode.Text
Me.conn.Open()
ds.Clear()
Me.da.Fill(ds.Tables("Artikellijst"))
r = ds.Tables("Artikellijst").Rows.Count()
For i = 0 To r - 1
bArtikel = ds.Tables("Artikellijst").Rows(i).Item("EANcode")
cArtikel = ds.Tables("Artikellijst").Rows(i).Item("Artikel")
dArtikel = ds.Tables("Artikellijst").Rows(i).Item("Verkoopprijs")
If aArtikel = bArtikel Then
On Error Resume Next
tekst1 = Me.txtAantal.Text
tekst1 = FormatNumber(tekst1, 0)
tekst2 = cArtikel
tekst3 = dArtikel
tekst3 = FormatNumber(tekst3, 2)
tekst4 = tekst1 * dArtikel
tekst4 = FormatNumber(tekst4, 2)
toevoeg = tekst1 & vbTab & tekst2 & vbTab & tekst3 & vbTab & tekst4
DataGridView1.Rows.Add(toevoeg)
Exit For
End If
Next
Me.conn.Close()
End If
End Sub
Re: Fill DataGrd with Value From Variabels
Please don't post the same question more than once.
http://www.vbforums.com/showthread.php?t=487767
Re: Fill DataGrd with Value From Variabels
Quote:
Originally Posted by jmcilhinney
Sorry, I didn't mean to. I'm new to the form. :blush:
Thanks,
E.