Programming help (debug)

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
 
D

Dan Artuso

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top