Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am receiving a run-time error 340 and conrol array element 71...

Status
Not open for further replies.

technovice

Programmer
Sep 14, 2001
11
0
0
GB
...doesn't exist.

This error sometimes occurs after a few hours of my package running (and it doesn't happen all of the time).

Any views on why it may occur would be most welcome.

Thanks
 
Hi Technovice,

The application obviously uses control a array (quite simply, an array of controls). These can be used, among other things, to dynamically generate forms. You have loaded anything up to 70 controls into a control array, however, somewhere in your application, you are trying to reference a 71st element. It doesn't yet exist, so you receive this error.

Good luck,

Rob
 
Firstly, a control array is not the same thing as an array of controls. Two completely different things.

With a control array, for example, the elements to not have to be numbered sequentially. It is perfectly acceptable, with a control array to have three elements, identified by 100, 140, and 160.

As far as the specific problem, I would guess that in your code, you are referencing a control with a subscript and that subscript represents a value that does not represents a valid control object. You need to trace back how the subscript value is calculated and determine why its value is incorrect. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
OK, OK, I'm reporting error 1234xxx: Terminology mismatch

You're right of course, the two are separate things. I should have said "Collection of controls". I also made an assumption about 70 controls having been loaded previously since that seemed to be the most likely scenario (it's uncommon for an application to load controls non sequentially).

The advice itself, however, stands.

Bount'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top