ما الخطأ في هذه الدالة لعمل ترقيم تلقائي داخل تقرير
Public Function rownom(rep As Report) As Variant
On Error GoTo Err_rownom
'Purpose: Numbering the rows on a report.
'Usage: Text box with ControlSource of: =rownom([reports]![theNameofthereport])
With rep.RecordsetClone
.Bookmark = rep.Bookmark
rownom = .AbsolutePosition + 1
End With
Exit_rownom:
Exit Function
Err_rownom:
If Err.Number <> 3021& Then 'Ignore "No bookmark" at new row.
Debug.Print "rownom() error " & Err.Number & " - " & Err.Description
End If
rownom = Null
Resume Exit_rownom
End Function
dbb2.rar