السلام عليكم
Dim xlast, xnext As Integer
Dim prtye, prttxt As Integer
xlast = DMax("fatoraid", "tblfatora", "left(fatoraid, 2) = myfatoratype()")
prtyr = Left(xlast, 2)
If IsNull(xlast) Then
xnext = 1
prtyr = myfatoraType()
Else
xnext = Val(Mid(xlast, 3, 5)) + 1
End If
Me.FatoraId = prtyr & Format(xnext, "00000")
كيف افهم