Hello, I have a form [frmShiftDay] with a subform [frmShiftMachinesSubform] and I needed a record counter on the subform to display “Machine # of #” which it does
with the VBA below BUT if I close the DB and open it then the textbox [txtMachineCount] displays “Machine 1 of 1” and if I hit my next button then it says the correct number of records. I tried to requery the textbox from the main forms on current event and
have had no luck. How can I get it to show the correct number without selecting my next button to refresh it? Thanks!
Private Sub Form_Current()
'-------------------------------------------------------------------------------------------------
' Counts and displays number of records or machines you have entered for the shift
'--------------------------------------------------------------------------------------------------
If Not Me.NewRecord Then
Me.txtMachineCount = "Machine " & CurrentRecord & " Of
" & RecordsetClone.RecordCount & ""
Else
Me.txtMachineCount = "Machine " & CurrentRecord & "
Of " & (RecordsetClone.RecordCount + 1) & ""
End If
End Sub