Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with MDIchild
Message
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00396987
Message ID:
00397495
Views:
17
>am using Service Pack 4
>
>I have found the problem to happen only when I load new unit forms. Here is the sample code I used to test it.
>
>Dim UnitForm() as new frmUnit
>Dim UnitNumber as long
>
>Private Sub MDIForm_Click()
>' Program unloaded fine before I clicked to make a new unit form
>' It will give an illegal operation now
>
>' Add a new form to our form array
>UnitNumber = UnitNumber + 1
>ReDim Preserve UnitForms(0UnitNumber) As New frmUnit
>
>UnitForms(UnitNumber).Show
>End Sub
>
What is th "0" on this line:
ReDim Preserve UnitForms(<B>0</B>UnitNumber) As New frmUnit
Do you have "Option Explicit"? It is the kind of the thing that is trap with this statement!
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform