• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

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
0
eliwil
Asked:
eliwil
1 Solution
 
peter57rCommented:
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
0
 
bluelizardCommented:
try:

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


--bluelizard
0
 
dannywarehamCommented:
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
eliwilAuthor Commented:
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
0
 
peter57rCommented:
There is nothing wrong with your syntax.
Therefore the problem must be with the names.  You need to check them all. Look in the database window to get the correct names for the forms, although it is the subform CONTROL names that you must use in your statement.

If you need an actual recordcount you will need to move to the last record of the recordsetclone first, but a >0 test should be OK.

Pete
0
 
Gustav BrockCIOCommented:
Where do you put this code? Maybe the subform hasn't been loaded yet. In that case no recordset exists.

/gustav
0
 
eliwilAuthor Commented:
Pete,

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

E
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now