Click to See Complete Forum and Search --> : New doesn't work


ant
July 3rd, 2001, 12:53 PM
I have the following code in an mdi form:\

private Sub new_Click()
Dim a as Form1
set a = new Form1
a.Caption = "new Script"
a.show
End Sub




And i also have a module with a function:


Function insertfunc()
Dim func as string
Dim ch
Dim func2 as string
ch = Chr(10)
func = InputBox("Enter function name")
func2 = "function " & func & "()" & ch & "{" & ch & "" & ch & "}"
insertfunc = func2
End Function



Everything works fine. I can create a new form, the function is called without any errors. But when i try to create another new form, it won't create another new one unless the first one is closed. I have the same code in other programs and it works fine. What am i doing wrong? I'll give ratings


--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: christopherfolger@hotmail.com
for the address

Iouri
July 3rd, 2001, 01:00 PM
' Declared somewhere'
Dim fFrm as frmYourHugeForm'


public Sub ShowAForm()'

set fFrm = new fFrm'
Load fFrm'
fFRM.show
End Sub


Iouri Boutchkine
iouri@hotsheet.com

ant
July 3rd, 2001, 05:23 PM
It gives me an error that says: User-defined type not defined. What's that mean?

--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: christopherfolger@hotmail.com
for the address

Iouri
July 5th, 2001, 08:15 AM
I think that the line

Dim fFrm as frmYourHugeForm'

gives you the problem

Rewrite it as
Dim fFrm as Form


Iouri Boutchkine
iouri@hotsheet.com