473,396 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Code error that nested form control not found

I have a nested forms 5 deep. The code is on the After Update event of a combo box control on the 1st Parent form. The intention is that when a user selects #2 from the drop-down on that first form, that certain controls in the nested forms will be disabled. The code works correctly for all of the controls except for the ShopName control (the last in the list). If I add a " ' " to the front of the line to make it a note, everything else works. The controls are all on the same subform and I've double-checked to make sure the control name is correct. Please help!

Expand|Select|Wrap|Line Numbers
  1. Private Sub FileType_AfterUpdate()
  2. If (Me.FileType = "2") Then
  3. Me!sfrmInspection.Form!sfrmLocation.Form!frmDamage.Form!sfrmEstimate.Form!Days.Enabled = False
  4.  
  5. Me!sfrmInspection.Form!sfrmLocation.Form!frmDamage.Form!sfrmEstimate.Form!TotalLoss.Enabled = False
  6.  
  7. Me!sfrmInspection.Form!sfrmLocation.Form!frmDamage.Form!sfrmEstimate.Form!lbPartCo.Enabled = False
  8.  
  9. Me!sfrmInspection.Form!sfrmLocation.Form!frmDamage.Form!sfrmEstimate.Form!Command24.Enabled = False
  10.  
  11. Me!sfrmInspection.Form!sfrmLocation.Form!frmDamage.Form!sfrmEstimate.Form!ShopName.Enabled = False
  12. End If
  13. End Sub
Thank you so much!
Aug 16 '12 #1
2 1773
twinnyfo
3,653 Expert Mod 2GB
Pamela,

Try renaming the text box to txtShopName and then point to that control in your code (as a reminder, please use the code tags when you post).

This "should not" be the cause of the error, but I find it is always a good practice to name the control on the form with a prefix (such as txt for a text box or cbo for a combo box), that way you (and others coming after you) are clear that you are talking about hte control and not the field underlying the control.

I don't know if this will fix it, but give it a try. Stranger things have happened in Access.....
Aug 16 '12 #2
Thanks for the tip. This db has been a long time in the works and so as I've begun to learn more, I've adapted some of these tips but my biggest concern in going back through and renaming is that it will then create a problem for other code that I have running. I don't know of a way to go back through and search every instance of where that control name would be in my db to update them also.


@twinnyfo
Aug 16 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Amir Eshterayeh | last post by:
Dear Friends Hope things goes well to you. I have this problem. Would you please give me your solution? I want to change a property that I define on my user control in my web form that contains...
2
by: Mark | last post by:
Hi, I'm running visual studio 2003, and am now receiving the error "The Operation Could Not Be Completed" when attempting to add a form / control or component class to a project. I can add any...
2
by: Denon | last post by:
Hi, everybody I have a web control, build by VB.net, and if I put two instance on the same aspx, error occur while debugging. Parser Error Message: Ambiguous match found. It highlight the...
1
by: Maziar Aflatoun | last post by:
Hi, I have tried setting up a nested repeater control and it works fine. But when I do 3 level nested repeater it fails. Does anyone know a site or have an example of a three level nestest...
3
by: | last post by:
For a given web form, I want to know what the +simplest+ way to add an attribute to all of a particular control type on that page. For example, I might want to add an onClick attribute to all...
10
by: Selden McCabe | last post by:
I'm trying to display some HTML on a form in a VB.Net project. I've referenced the COM WebBrowser control, and put an instance of it on my form. But during the Form_Load, I'm getting the...
21
by: Simon Verona | last post by:
Hope somebody can help! I want to automatically be able to add code to the initialize routine on a Windows form when I add a custom control that I've written to a form. Specifically, I'm trying...
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get the value of a form control? -----------------------------------------------------------------------...
0
by: Mark | last post by:
Hello I'm using VS2005 and doing a VB.Net project. Yesterday I changed one of my forms by removing a listview and a couple of buttons (contained in a tab page). These were recreated in a user...
4
by: Yo mama | last post by:
Hi! I have problem using simple custom form control on asp.net page. It does not do much. Just label and button. (It is for training purpose). My control works fine when I use it in my windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.