Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control_Initialize Question
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00607874
Message ID:
00607910
Vues:
18
Sure, here it is.

aPartCaptions is a single dimension public array loaded when the
application starts up.


Private Sub UserControl_Initialize()

 Dim iElement As Integer
 Dim sCaption As String

 For iElement = 0 To UBound(aPartCaptions)

  sCaption = aPartCaptions(iElement)

    If Alltrim(sCaption) <> "" Then

      cboParts.AddItem sCaption

    End If

  Next

End Sub


When I double-click on the form with the combo control on it in the
Project Window, I get a 'Subscript out of range error' on the line
with the 'For'.

The problem as I see it is that the UserControl_Initialize is firing
when VB attempts to open the form with the control on it in the
design window, but the array only exists in run-time.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform