Problem: public array loses elements (in usercontrol)

V

VB Programmer

I have a public array (in a usercontrol) defined as:

Public arrWebServers(0) As WebServers

' FYI:
Public Structure WebServers
Friend ServerName As String
Friend MapIdAc As Short
Friend MapIdDc As Short
Friend DatabaseName As String
End Structure

In a sub called ArrayLoad I load the array with several elements (let's say
10). (FYI: Each time I add an element I do a ReDim Preserve on it and
increase it by 1.) I checked the array as it was loading and it indeed
loaded.

Later, when I call arrWebServers.GetUpperBound(0) (from another sub WITHIN
the usercontrol) it has NO ELEMENTS.

Ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top