audition > 17-02-12, 10:08 AM
bomnhauag > 19-02-12, 11:05 AM
audition > 20-02-12, 10:45 AM
haquocquan > 22-02-12, 02:21 PM
Dim TB As Recordset
Set TB = Currentdb.OpenRecordset("congvanden", dbOpenDynaset)
If TB.RecordCount = 0 Then
Me.soden = "T001"
Else
DoCmd.GoToRecord , , acNewRec
TB.FindFirst "[Namlamviec]=" & me.txtNamlamviec
If TB.NoMatch Then
Me.soden = "T001"
Else
Me.soden = "T" & Format(Dmax(Cint(Rght([Soden],3)),"congvanden","[Namlamviec]=me.namlamviec")) + 1, "000")
End if
End If