Coba kl functionnya seperti ini:
Public Function GetNo(pTGL As Date) As String
Dim strDummy As String
strDummy = Nz(DMax("right([no],4)", "Tinput", "left([no],8)='" & Format(pTGL, "ddmmyyyy") & "'"))
If strDummy = "" Then
GetNo = Format(pTGL, "dd") & Format(pTGL, "mm") & Format(pTGL, "yyyy") & "0001"
Else
GetNo = Format(pTGL, "dd") & Format(pTGL, "mm") & Format(pTGL, "yyyy") & Format(Val(strDummy) + 1, "0000")
End If
End Function
Dim strDummy As String
strDummy = Nz(DMax("right([no],4)", "Tinput", "left([no],8)='" & Format(pTGL, "ddmmyyyy") & "'"))
If strDummy = "" Then
GetNo = Format(pTGL, "dd") & Format(pTGL, "mm") & Format(pTGL, "yyyy") & "0001"
Else
GetNo = Format(pTGL, "dd") & Format(pTGL, "mm") & Format(pTGL, "yyyy") & Format(Val(strDummy) + 1, "0000")
End If
End Function
semoga bermanfaat.
Salam hangat,
Coyev.
__._,_.___
SPAM IS PROHIBITED
MARKETPLACE
Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.
.
__,_._,___
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
No comments:
Post a Comment