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
Solved

Err:2455  invalid reference to the property Form

Posted on 2011-03-09
6
535 Views
Last Modified: 2012-05-11
I have a form which contains a subform which has a control name of sub_Well_Details.  This subform contains some text boxes and also contains a continuous subform (sub_Well_Component_Details).  Note that these are the control names, not the name of the forms.

The main form contains a treeview, and if the node selected is at the second level, I make sub_Well_Details visible, but I would also like to disable the Edit and Remove buttons on sub_Well_Component_Details if there are no records in the 2nd level subform.  To do this I'm using the following code in the nodeclick event of the treeview control.

Dim frm as Form
set frm = me.sub_Well_Details.form.sub_Well_Component_Details.Form   <--- problem is here
frm.cmd_Remove.Enabled = frm.REcordsetclone.recordcount
frm.cmd_Edit.Enabled = frm.cmd_Remove.Enabled

but the line beginning "set frm = " is generating the 2455 error "You entered an expression that has an invalid reference to the property Form/Report."

I have compacted, decompiled, checked my references, but nothing I do has resolved this problem.  I know I have used this syntax before for refering to controls on forms and for setting references to forms.

I've also tried:

set frm = forms("frm_Well_Components").sub_Well_Details.form

and

set frm = form_frm_Well_Components.sub_Well_Details.form
0
Comment
Question by:Dale Fye (Access MVP)
  • 4
  • 2
6 Comments
 
LVL 75
ID: 35090877
Is there any change that sub form object does not yet exist at the time the code is executed ?

mx
0
 
LVL 75
ID: 35091255
How about this Dale:
 
With me.sub_Well_Details.form.sub_Well_Component_Details.Form   <--- problem is here
     .cmd_Remove.Enabled = .Recordsetclone.recordcount
     .cmd_Edit.Enabled = .cmd_Remove.Enabled
End With

mx
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 0 total points
ID: 35123065
Joe,

Have tried the above, but have not had the opportunity to import all objects into a new accdb yet (am babysitting the grand-children this week while their parents are on vacation).  Hope to get a chance to look at this later this week.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 75
ID: 35123094
ok
0
 
LVL 47

Author Closing Comment

by:Dale Fye (Access MVP)
ID: 35304296
Joe, I was unable to resolve this problem until I imported everything into a new accdb, so my project must have experienced some form of corruption.
0
 
LVL 75
ID: 35305864
ok. good.

mx
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

792 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