Link to home
Start Free TrialLog in
Avatar of joyriderank
joyriderank

asked on

Load form with the use of variables

Hi Experts,

I am facing a problem in loading forms in VB, by calling the form name through a variable. Like :

dim ank as string
ank = "frmMain"
Load ank

the above code is giving me problems and I am unable to figure out a way to get past this problem. I think that the solution would be easy for you experts with years experience but silly me could not get through this small problem. I would really appreciate all the help I can get with this problem of mine.

Chalo that will be all for now. TAKE CARE you guys and gals.

Thanks in advance. :):):)

Joyriderank.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

unfortunately, even we with years of experience don't have anything except workarounds for this problem. Unless the form is not loaded, you can't get it's object reference and check it's name, and thus you can't load one (as the load function requests an object).
CHeers
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry, you are right... but this is new in VB6, I start to loose my vb-knowledge, doing too much stuff in db :(
CHeers
Avatar of joyriderank
joyriderank

ASKER

Thanks for your help with the problem guys. I will check out your suggestion TimCottee and get back to you if I face any problems.

Chalo that will be all for now. TAKE CARE guys. :):):)

Joyriderank.
Thanks TimCottee for the answer. It wroked just great. Thanx a lot for the advice.

Take Care.

Joyriderank.