Access 2003:
My users want to print the record number of a record as shown in the navigation area on the bottom of a form on a report. I explained to them that this number will vary as records are inserted and deleted in the table. They understand this but want to see the current record number on the report.
I set up VBA code in the Detail | Print event of the report as follows:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngrecordnum As Long
lngrecordnum = Forms![Donor Form].CurrentRecord
Text29 = lngrecordnum
End Sub
I’m getting the message “Microsoft Access can’t find the form Donor Form referred to in a macro expression or Visual Basic code” when the form is not open. When the form is open, I don’t get that message but, instead, I get the number 1 for all records.
I don’t want the form to be open when they run this report. The form name is spelled correctly. What am I doing wrong?
TIA.