well how about instead.
Sub Main
in a main module.
dim flogin as new frmLogin
'check a Successful property--that you should create--on 'flogin
to see if successful--or better yet maybe you just want the login dialog to
get username and password and when user click OK, close form, and then in
Sub Main read a UID and PWD property from flogin form--that you would
create, do your login validation and allow entrance or exit the program
if flogin.Successful then
dim fMain as new frmMain
fMain.ShowDialog
end if
end Sub
HTH,
Shane
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:uD*************@TK2MSFTNGP12.phx.gbl...
My login form will call a main form with menu
in my button_OK click eventdim frmMain as new mainform
frmMain.show()
Me.dispose()
The login form didn't close by itself, Please help.. Thanks