Computing.Net > Forums > Programming > VB6 Opening a Form from a string in code

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

VB6 Opening a Form from a string in code

Reply to Message Icon

Name: Brad
Date: August 6, 2002 at 18:17:02 Pacific
Comment:

Can anyone help a newbie
I am tying to open a form from a string, eg the string value is "Form1"
When I try to use it "string.show" it comes back with "Compile Error: Method or data member not found"
But when I use "Form1.show" (the forms name) the form opens.
Any help is appreciated



Sponsored Link
Ads by Google

Response Number 1
Name: orione999
Date: August 6, 2002 at 23:55:16 Pacific
Reply:

I'm a newbie too; try and use :

strNameForm = "Form1"
Forms(strNomeForme).show

I'ma VBA programmer, not VB6...but the mechanism must be the same.



0

Response Number 2
Name: Brad
Date: August 7, 2002 at 15:28:45 Pacific
Reply:

Thanks for the tip.
I tried that one and ended up with a Type Mismatch Error.

I tried dimming the Variable as a a string, and variant with no luck.


0
Reply to Message Icon

Related Posts

See More


how to cover pop-up ad wi... Newb



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6 Opening a Form from a string in code

searching a string in a text file www.computing.net/answers/programming/searching-a-string-in-a-text-file/17972.html

Find and replace a string in a file www.computing.net/answers/programming/find-and-replace-a-string-in-a-file/19034.html

Adding tabs in a string in vb.net www.computing.net/answers/programming/adding-tabs-in-a-string-in-vbnet/11853.html