I have two forms, one is form1 for registration and the other one is form2 for my main menu. How to call the form2 if the user successfully register with the form1. The code in form 1 is me.close (to close the form1) then form2.show but it will not work.
Hi guys, can you help me in my vb.net project. The problem is that I need to call a form, but I also need to know the form who calls the next form. Because I plan to make an if statement so that the program will know which line of code to execute depending on the form who calls the next form.
It's a database program. And I already have this line of code for the savings account alone. I will need more line of codes for the Dollar and current accounts.
This line of code will read the database. It's a log-in form that accesses the database:
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\Documents and Settings\Student\nrew\db1.mdb;")
Dim cmd As OleDbCommand = New OleDbCommand("Select * from clients where NAME= '" & TextBox1.Text & "' AND PIN = '" & TextBox2.Text & "' ", cn)
Dim rdr As OleDbDataReader
rdr = cmd.ExecuteReader
If rdr.HasRows Then
NoAcc = rdr("NAME")
NoPin = rdr("PIN")
If (TextBox1.Text = NoAcc And TextBox2.Text = NoPin) Then NoAccmod2 = NoAcc