BELAJAR SENDIRI COMPUTER Headline Animator

Sabtu, 25 Desember 2010

Cara membuat Counter Otomatis dari Tanggal

Private Sub Auto()
Dim urutan As String * 10
Dim hitung As Long
With DTPenjualan.Recordset
If .RecordCount = 0 Then
urutan = Right(Date, 2) + Mid(Date, 4, 2) + Left(Date, 2) + "0001"
Else
.MoveLast
If Left(!Nota, 6) <> Right(Date, 2) + Mid(Date, 4, 2) + Left(Date, 2) Then
urutan = Right(Date, 2) + Mid(Date, 4, 2) + Left(Date, 2) + "0001"
Else
hitung = (!Nota) + 1
urutan = Right(Date, 2) + Mid(Date, 4, 2) + Left(Date, 2) + Right("0000" & hitung, 4)
End If
End If
TNota = urutan
End With



End Sub

Tidak ada komentar:

Posting Komentar

Cari Blog Ini

Pengikut