VB 6 Forms

Thread Starter

Mazaag

Joined Oct 23, 2004
255
Hey Guys,
Quick questions about forms in VB 6.

I want to have like a login screen for my application ( as a seperate form ), and if the password is correct, it opens another form , and CLOSES the login form.

With VB 6 , there is like a template "login" page, which I can add into my project.

My question is , how do I set the function to close the login in form and open the second one when the password is correct ? and is there an order in which the forms are opened when the application is executed? if there is, how do I set it ?

Thanks Alot guys
 

n9352527

Joined Oct 14, 2005
1,198
I don't have a copy of VB6 handy, but I know that on project properties (or something similar) dialog you could set which form is first invoked. You could also set a module (function) instead of a form.

So, either you set the login form as the first form, and invoke the app form after that or you could invoke them from a module.
 

mickjack

Joined Feb 22, 2006
1
Originally posted by Mazaag@Feb 14 2006, 07:52 PM
Hey Guys,
Quick questions about forms in VB 6.

I want to have like a login screen for my application ( as a seperate form ), and if the password is correct, it opens another form , and CLOSES the login form.

With VB 6 , there is like a template "login" page, which I can add into my project.

My question is , how do I set the function to close the login in form and open the second one when the password is correct ? and is there an order in which the forms are opened when the application is executed? if there is, how do I set it ?

Thanks Alot guys
[post=14036]Quoted post[/post]​
create a sub main() in a module
make this your startup
design your login form and have a public boolean var called bOK
(or bLoginSucces or whatever) and one button (btnLogin)
load this modally in main() ie. frmLogin.show vbmodal

in frmLogin...
create a function to check name/password
and set bOK to true
in btnLogin_click event....
me.hide (not me.close)

in main()
....after frmLogin.show vbmodal
check frmLogin.bOK
if true then load main form or exit

Thats all!
 
Top