reference to Subform's subform RecordsetClone

Posted on 2005-03-31
Medium Priority
Last Modified: 2008-02-20
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

Question by:eliwil
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 77

Expert Comment

ID: 13678672
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.

LVL 14

Expert Comment

ID: 13678691

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

LVL 26

Expert Comment

ID: 13678752
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.


Author Comment

ID: 13679183

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


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

LVL 77

Accepted Solution

peter57r earned 2000 total points
ID: 13679332
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.

LVL 51

Expert Comment

by:Gustav Brock
ID: 13680335
Where do you put this code? Maybe the subform hasn't been loaded yet. In that case no recordset exists.


Author Comment

ID: 13688687

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


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question