thanhtruong > 30-03-15, 02:41 PM
Private Sub Form_Current()
'kiêÒm tra sôì thýì týò, nêìu Null thiÌ ðây laÌ record mõìi
If IsNull(Me.STT) Then
STT.Value = SoTT
End If
End Sub
Function SoTT() As String
Dim so As Integer
so = Nz(DMax("[Couter]", "BangChi", "[Date]= date()"))
Couter.Value = so + 1
SoTT = Date & "-" & Format(Couter, "000")
End Function
maidinhdan > 30-03-15, 11:08 PM
Function SoTT() As String
Dim so As Integer
so = DMax("[Couter]", "BangChi", "Year(Ngaylamviec) = " & Year(Date()))
If Nz(so, 0) = 0 Then
Couter.Value = so + 1
Else
SoTT = Date & "-" & Format(Couter, "000")
End If
End Function