Programming help (debug)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following code. Basically, I'm trying to retrieve the number of
record being displayed in my subform and the display that number in a text
box on the main form. However, i keep getting an error message that states
the it doesn't support that property.... Could someone please tell me what
I've missed?! The error occurs on the Recs=... statement

Dim Recs as integer
Recs = Forms![Stress Report Cross-Reference]![Stress Report Tbl
Subform1].Recordset.RecordCount
Me.RecordCounter = Recs & " Records Match Your Selection"

Thank you for the help

Daniel
 
Hi,
I assume that Stress Report TblStress Report Tbl is the name of the
subform control? This is not the same as the subform itself. What you see on your
form in design view is a 'subform control' that hosts the subform itself.

So you have to use the Form property of the subform control to get a reference to the
actual subform.

Recs = Forms![Stress Report Cross-Reference]![Stress Report TblSubform1].Form.Recordset.RecordCount

HTH
Dan Artuso, MVP
 
Back
Top