(VB 2010) Expression does not produce a value?

Home > Computers & Internet > Programming & Design > (VB 2010) Expression does not produce a value?
StevenSteven


Im just trying to open a new form and close the current form, its pretty simple but im new in vb

code:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim login = Me.UserpasswordTableAdapter1.usernamepas¦ textpassword.Text)

If login Is Nothing Then

MsgBox("incorrect details")

Else : Form2.Show()

End If

If Form2.Show Then

Me.Hide()

End If

End Sub

// adsense
Jay
Jay

Make an event for when the current form closes, and make it so that if the login is correct then the current form will close and on in that close event for the current form make it so that the other form shows.


Other Questions & Answers

Why does my computer freeze every night but is ok during the day.......?
I posted a question not too long ago and the user told me to upgrade 'Java'. I did and it was ok after that but now, has started freezing ag ... Read more (3 answers)
How do you get listed on Google?
Hi,My website not getting listed in Google.please tell me how do you get listed on google? ... Read more (4 answers)
My right margin is getting cut off when printing index cards?
I have the margins set correctly - I even tried to have no right margin, but my printer is still cutting off the right margin about an inch too soon. ... Read more (1 answers)
Can i download google images on my computer?
I want to download some images i found on googlei am not going to copy them around the web or anything i just want to save them on ... Read more (7 answers)
How to get your blog on Google search?
Can anybody please tell me.how to get your blog on Google search?Thank you. ... Read more (4 answers)