Charlottew14
Registered User.
- Local time
- Today, 18:11
- Joined
- Oct 4, 2012
- Messages
- 32
Hi,
I have a form, with three different sub forms on it. Rather than us the record counter at the bottom of the subforms, i'm creating my own using this code:
Private Sub Form_Current()
Dim rst As DAO.Recordset
Dim lngCount As Long
Set rst = Me!subform.Form.RecordsetClone
With rst
.MoveLast
lngCount = .RecordCount
End With
Me.txtCount = "#" & " " & lngCount
End Sub
which works fine. But if I want to count the records in two subforms, how does that work?! I've tried copying and pasting the code again, but I just get an error
Any help would be much appreciated!
Thank you!!
I have a form, with three different sub forms on it. Rather than us the record counter at the bottom of the subforms, i'm creating my own using this code:
Private Sub Form_Current()
Dim rst As DAO.Recordset
Dim lngCount As Long
Set rst = Me!subform.Form.RecordsetClone
With rst
.MoveLast
lngCount = .RecordCount
End With
Me.txtCount = "#" & " " & lngCount
End Sub
which works fine. But if I want to count the records in two subforms, how does that work?! I've tried copying and pasting the code again, but I just get an error
Any help would be much appreciated!
Thank you!!