Download source code vb6, source code delphi7, tutorial vb, tutorial delphi, tutorial php

Penomoran otomatis

Share on :

Desain Nomor otomatis Visual Basic


secara simple yang akan saya ajarkan hanya berupa form kecil.

Syarat yang dibutuhkan:
- Label (1)
- TextBox(1)
- Adodc (1)
- DBGRID(1)
- CommandButton(1)

setelah selesai mendesain, langkah selanjutnya adalah input code ini di form
  1. sub otomatis()  
  2. dim nomor,otomatis as string  
  3. adodc1.recordsource = "select kode_barang from barang"  
  4. adodc1.refresh  
  5.   
  6. if adodc1.recordset.recordcount = 0 then  
  7. otomatis = "B-001"  
  8. else  
  9. adodc1.recordset.movelast  
  10. nomor= Right (adodc1.recordset!kode_barang,3)+1  
  11. otomatis= "B-"&right("000"&nomor,3)  
  12. end if  
  13. textboxt1.text= otomatis   
  14. end sub  

*Setelah selesai panggil sub tersebut di Form_load dengan nama "otomatis"

Klik Like/share jika anda menyukai tulisan Share


1 komentar:

Deni Indrawan mengatakan... 21 April 2011 pukul 01.57

ok...sip bgt tuh ilmunya...

klo ada objek listview / datagrid,bisa lbh simpel lg ...

Post a Comment and Don't Spam!

Terimakasih Sudah Berkomentar di artikel ini