Membuat Kode Bahan secara otomatis menggunakan Visual Basic 6.0

Koneksi menggunakan Data Environment…

Private Function autokodebhn()
Dim fcode As String
Dim scode As String

With DE
fcode = “BHN-”

If .rskodebahan.RecordCount <= 0 Then
scode = “0001″
Else

.rskodebahan.MoveLast
scode = Right(“000″ + Trim(Str(Val(Right(.rskodebahan!Kode_Bahan, 4)) + 1)), 4)
End If

autokodebhn = fcode + scode
txtdatabahan(0).Text = autokodebhn

End With

End Function
Panggil Function di atas pada saat tombol tambah / add di klik, emm….pa lagi ya !!!!!!!
Oya..gk cuma bisa buat Kode Bahan aja, pake Kode Karyawan ato yang lainnya jg bisa !!!!!

nie aq di ajarin ama dosen aq..katanya dia yg nemuin coding ini..bgono..

Satu Tanggapan

  1. tengkyu bang.. bisa dicoba tuh…

    25 Maret 2011 pada 4:17 AM

Tinggalkan Balasan

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Ubah )

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.