Access MVP (2010-2015)

oOo.oOo.oOo.oOo.oOo.oOo

Custom Record Count…

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…

CardOfCards

Click to see entire Form


txtPage
is the name of the unbound TEXT field between the Navigation Buttonscard(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

ContractPageOfPages

Click to see entire Form

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(*)))
Figure 1

Figure 1

210 total views, 1 views today

Comments are closed.