473,400 Members | 2,163 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,400 software developers and data experts.

Method 'Items' of object "Forms" failed

I found a post with the same error here.
I'm getting the same error. This code is run in a button click event:
Expand|Select|Wrap|Line Numbers
  1. ...........
  2. DoCmd.OpenForm CurTabViewName, acNormal
  3. With Forms(CurTabViewName) 
  4. ...........
  5.  
At the "With" statement I get the error. Weird thing is this code had been working fine a long time. I've been searching the net and haven't been able to find the solution yet. Does anyone know a solution?

Only possibility I found out (from the above linked post) is that maybe it has to do with timing. I can imagine that the form is not completely ready when the "with" statement executes. Is there any way to tell access to wait until the form is completely loaded before executing the "with" statement?
Jul 22 '08 #1
3 7797
hyperpau
184 Expert 100+
have you tried putting a refresh, repaint, or recalc method in betweene these codes?
Aug 18 '08 #2
missinglinq
3,532 Expert 2GB
Access executes Command2 without waiting for Command1 to finish executing, which can, indeed, cause timing problems. In this case, my guess is that the form hasn't finished loading/opening when the next line of code tries to reference it.

Refresh, repaint, or recalc is going to do nothing to correct this. What does frequently help is to place the command DoEvents between two commands.
DoEvents basically sends control from Access to Windows to allow Command1 to finish before returning control to Access to execute Command2.

Welcome to Bytes!

Linq ;0)>
Aug 19 '08 #3
hyperpau
184 Expert 100+
Wow. That's new for me! :)

Thanks Missingling.


Access executes Command2 without waiting for Command1 to finish executing, which can, indeed, cause timing problems. In this case, my guess is that the form hasn't finished loading/opening when the next line of code tries to reference it.

Refresh, repaint, or recalc is going to do nothing to correct this. What does frequently help is to place the command DoEvents between two commands.
DoEvents basically sends control from Access to Windows to allow Command1 to finish before returning control to Access to execute Command2.

Welcome to Bytes!

Linq ;0)>
Aug 19 '08 #4

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

Similar topics

0
by: Simon Verona | last post by:
I know this is a little of topic, for which I apologise, but I think it's pertinent to .Net development so I hope it's ok to ask this question here! I'm looking to created filled in "forms" from...
0
by: Woody Lemcke | last post by:
Hello all, Would you gurus please share your wisdom on any DB2 equivalents to the Informix "Forms" input form utility and "Ace" report generating utility? The input form will probably be accessed...
0
by: gmarquez | last post by:
Hello, I am using "FORMS" authentication, without SSL the behavior is normal, everythings working very well. When in IIS I cheking "Require SSL" (in Secure Communications property), I can't to...
0
by: Angel | last post by:
Hi I have a problem with my web applications. I believe the problem is somehow connected to HttpSession. I use form authentication in my project. Once I authenticate the user and redirect to...
4
by: Scott Johnson | last post by:
Hi! Is there a way to "preload" a form using a thread or something else so that my user doesn't have to wait 5 seconds (initializing time) between forms? Some of these forms have tab strips with...
1
by: Dib | last post by:
Hi, how do I call a form to open from another form. example I have a frmLogIn and an frmError The frmError have a ListBox. If the frmLogin generated an error I want the error to show in...
17
by: Paul Helmuth | last post by:
All, (here's an easy one)... This is probably a stupid question - please bare with me as I am new to dotNet. How does one reference objects on a form from a module? In 6.0 you could simply...
1
by: Troy Bull | last post by:
Greetings I am trying to use a singleton to hold a group of forms. I have a MDIMaster form. I have a class called Forms; Forms is a singleton. I want to do something like the following. In...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.