D
DEI
I am using the following code to make a control in a form
count records in its subform. It works great (thanks Jim)
except I get an error when the subform has no (zero)
records. How do I debug it.
Also-where is the best place to put this code? So it
updates the fastest?
Thanks.
Private Function fSubFormRecCount() As Long
Dim frm As Form
Set frm = Me.SubformControlName.Form
frm.RecordsetClone.MoveLast
fSubFormRecCount = frm.RecordsetClone.RecordCount
Set frm = Nothing
End Function
count records in its subform. It works great (thanks Jim)
except I get an error when the subform has no (zero)
records. How do I debug it.
Also-where is the best place to put this code? So it
updates the fastest?
Thanks.
Private Function fSubFormRecCount() As Long
Dim frm As Form
Set frm = Me.SubformControlName.Form
frm.RecordsetClone.MoveLast
fSubFormRecCount = frm.RecordsetClone.RecordCount
Set frm = Nothing
End Function