I have got menu bar.
In that there is Logout option also.
When the user clicks on Logout then it should pop up the msg that "successful logout" and close the current page and redirect to login form.
I wrote this code:
Me.Close()

    MsgBox("Logout Successful")
    Form1.Show()
    Form1.TextBox1.Text = ""
    Form1.TextBox2.Text = ""

Form1 is login form.
Is there anything wrong in this?
This code is working fine for 1 form but not for other form.

here is an anology :
i have two form, LoginForm and MainForm

when user success login :

LoginForm.Visible = False
MainForm.Show()

and when user logout :

MainForm.Close()
LoginForm.Visible = True

hope give you some imagination.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.