PDA

Click to See Complete Forum and Search --> : Blank Form


juanki23
Sep 21st, 2002, 05:19 PM
Show a new Blank Form using Code

Ej.

Programming a CommandButton that show a new Form without using Add Form in Visual Basic

I'm try this

dim frmC as form
set frmC = new Form
but this don't work

I know that I can put
set frmC = new Form1 but this show all element in the form1 and if I change the name of form1, this make and error.
I need that when click the button appear a new Blank Form.

I need this to implement my Activex Control.

Send me an email to juanki23@hotmail.com

LucianoBraatz
Sep 22nd, 2002, 12:00 AM
I think it will work.
dim frmC as form
set frmC = new Form
frmC.show


Using the code you listed just create a new FORM object, but it's not explicit you want to show it.

juanki23
Sep 22nd, 2002, 03:24 AM
Nop, this not work
this give a compile error
Invalid use of New Keywork

if I put

Dim frmC as form
set frmC = new Form1
frmc.show

this work but when I change the name of the form, this give an error

holly
Sep 23rd, 2002, 02:33 PM
Originally posted by juanki23
Nop, this not work
this give a compile error
Invalid use of New Keywork

if I put

Dim frmC as form
set frmC = new Form1
frmc.show

this work but when I change the name of the form, this give an error #

You will have to change your code to suit your form names

holly