There are times you want to display a Record Count on your Form. Or, maybe, you want to use your own Navigation Buttons but how to get the Record Count to display? Here are two options…
txtPage is the name of the unbound TEXT field between the Navigation Buttons. card(s) is what they are. You can change that to *ticket(s)*, *paper(s)* or whatever it is you are counting. In the Form’s On_Current event place…
Private Sub Form_Current()
On Error Resume Next If Me.RecordsetClone.RecordCount = 0 Then Me.txtPage = "" DoCmd.CancelEvent Else With Me.RecordsetClone .MoveLast Me.txtPage = Me.CurrentRecord & " of " & .RecordCount & " card(s) End With End If
End Sub
OR
Create a unbound TEXT box on your form, mine is txtRecordNos, and copy everything after txtRecordNos into the Control Source for the TEXT box (Figure 1)…
txtRecordNos = IIf([CurrentRecord]>(Count(*)),'New Record',(‘Contract ' & [CurrentRecord] & ' of ' & Count(*)))
1,807 total views, 1 views today