FORM POPUP SUPPLIER
Jumat, 13 Mei 2011
CODING POPUP SUPPLIER
Imports System.Data.OleDb
Imports System.Data
Public Class PopSup
Public retKdSup, retNmSup, retAlmtSup As String
Dim cnn As OleDbConnection
Dim cmmd As OleDbCommand
Dim dReader As OleDbDataReader
Private Sub popSup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call list_data()
End Sub
Private Sub Txtkey_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtkey.TextChanged
Call list_data()
End Sub
Private Sub list_data()
Call list_data()
Dim sqlx As String
Dim x As Integer
sqlx = "select KDSUP, NMSUP, TALAMAT from SUPPLIER where NMSUP like '&" & Trim(Txtkey.Text) & "&' order by KDSUP asc"
cnn = New OleDbConnection(strConn)
If cnn.State <> ConnectionState.Closed Then cnn.Close()
cnn.Open()
cmmd = New OleDbCommand(sqlx, cnn)
dReader = cmmd.ExecuteReader
Try
While dReader.Read = True
x = Val(counter.text)
Counter.text = Str(Val(counter.text) = 1)
With ListView1
.Items.Add("")
.Items(ListView1.Items.Count - 1).SubItems.Add("")
.Items(ListView1.Items.Count - 1).SubItems.Add("")
.Items(ListView1.Items.Count - 1).SubItems.Add("")
.Items(x).SubItems(0).Text = dReader.GetString(0)
.Items(x).SubItems(1).Text = dReader.GetString(1)
.Items(x).SubItems(2).Text = dReader.GetString(2)
End With
End While
Finally
dReader.Close()
End Try
cnn.Close()
End Sub
Private Sub clear_list()
While Val(counter.text) > 0
ListView1.Items(0).Remove()
Counter.text = Val(counter.text) - 1
End While
End Sub
Private Sub ListView1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.DoubleClick
Call pilih()
End Sub
Private Sub pilih()
Try
retKdSup = ListView1.SelectedItems(0).SubItems(0).Text.ToString
retNmSup = ListView1.SelectedItems(0).SubItems(1).Text.ToString
retAlmtSup = ListView1.SelectedItems(0).SubItems(2).Text.ToString
Me.Close()
Catch ex As Exception
MsgBox("pilih salah satu data", MsgBoxStyle.Information)
End Try
End Sub
Private Sub BtnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOK.Click
Call pilih()
End Sub
Function retTglSP() As Object
Throw New NotImplementedException
End Function
End Class
Free Template Blogger collection template Hot Deals BERITA_wongANteng SEO theproperty-developer
Diposting oleh
Vini Widiantika
di
22.27
Kirimkan Ini lewat Email
BlogThis!
Bagikan ke X
Berbagi ke Facebook
Langganan:
Posting Komentar (Atom)

0 komentar:
Posting Komentar