>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 frmUnitDo you have "Option Explicit"? It is the kind of the thing that is trap with this statement!