Dear Experts,
Appreciate if you could help me out with the VBA code for displaying record count of a subform in a label on the main form.
I found following code to display record count in a label.
The label is on my main form (frmMain) which displays as subform frmqryEventsub labeled lblEvent. I want to show this label as Events RecorCount, eg Events 5.
Many thanks.
Appreciate if you could help me out with the VBA code for displaying record count of a subform in a label on the main form.
I found following code to display record count in a label.
Code:
Private Sub Form_Current()
If Me.NewRecord Then
Me.lblEvent.Caption = _
"Events (" & Me.Recordset.RecordCount + 1 & ")"
Else
Me.lblEvent.Caption = _
"Events (" & Me.Recordset.RecordCount & ")"
End If
End Sub
The label is on my main form (frmMain) which displays as subform frmqryEventsub labeled lblEvent. I want to show this label as Events RecorCount, eg Events 5.
Many thanks.