hii
i want form show
but
i write form name in textbox and click the show button
how
thanks
Printable View
hii
i want form show
but
i write form name in textbox and click the show button
how
thanks
VB Code:
Private MyForm As Form Private Sub Command1_Click() Set MyForm = Text1.Text MyForm.Show End Sub
Is this what you mean?VB Code:
Private Sub Command1_Click() Dim frm as Form For Each frm in Forms if frm.Name = Text1.Text then frm.Show Next End Sub
Code:Select Case Text1.Text
Case "Form1"
Form1.Show
Case "Form2"
Form2.Show
End Select
Just noticed, Mine only works for loaded forms
Hack, your code will not work. You must assign a form object to object form. I know how to do this with controls. I don't think you can do this with forms unless they're loaded.
VB Code:
Private Sub Command1_Click() Dim frm As Form Set frm = Forms.Add(txtFormName.Text) frm.Show End Sub
:)
:eek: You are correct sir. Thats what I get for posting code I've written off the top of my head without testing it. In fact, the only code that has been posted so far that works on forms not yet loaded is Cander's.Quote:
Originally posted by vbgladitor
Hack, your code will not work. You must assign a form object to object form. I know how to do this with controls. I don't think you can do this with forms unless they're loaded.
Sorry for misleading you akyolfatih. :rolleyes:
VB Code:
Private Sub Command1_Click() Dim frm As Form Set frm = Forms.Add(txtFormName.Text) frm.Show End Sub
Cool. I knew that. he he he :-)
Very nice...:D