I have a login form with the code below:When i run this code and click OK, i get an error at f.show which says'Object reference not set to an instance of an object.'Code:Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click If txtuser.Text = "sky" And txtpass.Text = "123" Then Dim f As MDIParent = Me.MdiParent f.Show() Me.Close() 'Me.Hide() 'MdiParent.Show() Else MsgBox("Incorrect user info") txtuser.Focus() End If End Sub
How do i go about it so that i can get a smooth login an access my MDI form?


Reply With Quote
Rate People That Helped You