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
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar