'Access- counting scanned records

I'm trying to create a counter for each time a Tracking Number is scanned into a form. Although the display box and buttons from the code below work, I can't figure out how to progressively display "y" either on an unbound box or by clicking the count button.

Private Sub Tracking_Number_AfterUpdate()

    Dim x As Integer
    Dim y As Integer
    x = 20
    
    Do Until y >= x
    y = y + 1
    Next
    
    TotalCount = y
End Sub

Private Sub CountButton_Click()
    MsgBox y
End Sub

Private Sub ResetCount_Click()
Call form_load
Call Form_Current
End Sub


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source