Link to home
Start Free TrialLog in
Avatar of eliwil
eliwil

asked on

reference to Subform's subform RecordsetClone

I'm trying to reference a subform's subform RecordsetClone and getting the error: Can't find the field 'fsubGrtCycle' referred to in your expression. Here's what I'm using. Can you see where I'm going wrong?

    If Forms!frmMainInd!fsubGrtOrg.Form!fsubGrtCycle.Form.RecordsetClone.RecordCount > 0 Then
.........

E
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi eliwil,

Make sure that fsubGrtCycle is the name of your sub-subform CONTROL on the subform.  The control usually has the same name as the form it contains but it is not necessarily so.


Pete
try:

If Forms!frmMainInd!fsubGrtOrg.Controls("fsubGrtCycle").Form.RecordsetClone.RecordCount > 0 Then


--bluelizard
Avatar of eliwil
eliwil

ASKER

Peter,

fsubGrtCycle is the name of both the form and the subform control.

Bluelizard,

Tried your reference and got the same "can't find the field..." error as before.

E
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Where do you put this code? Maybe the subform hasn't been loaded yet. In that case no recordset exists.

/gustav
Avatar of eliwil

ASKER

Pete,

I had missed a layer. It was actually nested not one layer down on a subform but two.

E