إنسخ هذا في مربع نص الترقيم التلقائي طبعا إذا كان مربع النص التلقائي اسمه ID
=RcNum([Form];"ID";[ID])
ثم انسخ الكود هذا في الوحدة النمطية
Function RcNum(frm As Form, fldName As String, mID As Variant) As Variant
Dim RstClone As Recordset
Dim Fld As Field
Dim I As Long
RcNum = Null
If IsNull(mID) Then Exit Function
Set RstClone = frm.RecordsetClone
If RstClone.RecordCount = 0 Then Exit Function
Set Fld = RstClone.Fields(fldName)
With RstClone
.MoveFirst
Do Until .EOF
I = I + 1
If Fld = mID Then Exit Do
.MoveNext
Loop
End With
RstClone.Close
RcNum = I
End Function