coba kode ini :
NIP.Text = AdoAkhir.Recordset!NIP
Panjang = 5
If val(NIP.Text) = 0 Then
strNoUrut = "00001"
Else
Total = Val(NIP.Text) + 1
If Len(Total) <= Panjang Then
'untuk menghitung jumlah nol
For i = 1 To Panjang - Len(Total)
strNol = strNol & "0"
Next
strNoUrut = strNol & Total
Else
strNoUrut = Total
End If
End If
NIP.Text = strNoUrut
"chai.chang.an" <[EMAIL PROTECTED]> wrote:
Hallo teman vb,
gimana cara menambahkan angka terakhir nip misalnya nip terakhir saya 00141,
nah nanti di nip.text jadi 00142
AdoAkhir.RecordSource = "select top 1 nip from pegawai order by nip
desc"
AdoAkhir.Refresh
NIP.Text = AdoAkhir.Recordset!NIP + 1
kalau pakai perintah diatas langsung jadi 142
thank's
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates
starting at 1ยข/min.
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/zCsqlB/TM
--------------------------------------------------------------------~->
Untuk berhenti berlangganan kirim email kosong ke : [EMAIL PROTECTED]
Forum ini berkembang dengan pesat, jika anda memiliki
dedikasi dan waktu, silahkan mengaplikasikan diri
menjadi moderator.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/indoprog-vb/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/