Hi, I found a thread I was hoping would solve may problem of how to put a "Record x of y" box on my form, but it's apparently too old for me to reply to directly. The solution which was posted on the thread is below, but I cannot figure out how to make the results show up on the form. I think I have all the VBA in place correctly, but the form is showing an Unbound Label named RecNum in design view, and in form view the label just shows the "A" placeholder. What am I missing?
fneily (Instructor) 20 Sep 06 10:25
At the top or whereever, put an unbound Label control (create a label and type the letter A so it is created). Call it RecNum
Open your form in design view and go ALT+F11 to go to VBA.
Code:In the top section, put: Option Compare Database Option Explicit Dim Records As DAO.Recordset Dim TotalRecords On the form's OnLoad event, put: Set Records = Me.RecordsetClone Records.MoveLast TotalRecords = Records.RecordCount On the form's OnCurrent event, put: If Not Me.NewRecord Then Records.Bookmark = Me.Bookmark Me![RecNum].Caption = "Record " & Records.AbsolutePosition + 1 & " of " & TotalRecords Else Me![RecNum].Caption = "New Record" End If Add two more sub's: Private Sub Form_BeforeInsert(Cancel As Integer) Me![RecNum].Caption = TotalRecords + 1 & " pending..." End Sub Private Sub Form_AfterInsert() Records.MoveLast TotalRecords = Records.RecordCount End Sub