This is my login form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=C:/Users/Space Era/Documents/User.mdb")
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM Users WHERE userid = '" & TextBox2.Text & "' AND password = '" & TextBox1.Text & "' ", con)
con.Open()
Try
Dim sdr As OleDbDataReader = cmd.ExecuteReader()
' If the record can be queried, Pass verification and open another form.
If (sdr.Read() = True) Then
Form4.Show()
Me.Hide()
Else
MessageBox.Show("Invalid username or password!")
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Oledb Error")
End Try
End Sub
Private Sub Cancel_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Now i want to add a logout linklabel to the main form i.e. form4 ,how do i code it to logout the user and show the login form