Membuat Kode Bahan secara otomatis (koneksi database 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, tapi mikir ndiri ya !!!!!
biar otaknya gk males….he..he…

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.