Imports System.Data
Imports System.Data.OleDb
Public Class Form2
    Dim frm1 As New Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        SQL = " insert into table1(name,city,mobile)" & _
        "values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "')"

        Dim savinto As New OleDbCommand(SQL, dbconn)

        dbconn.Open()
        savinto.ExecuteNonQuery()
        dbconn.Close()

        MsgBox("لقد تمت عملية الاضافة والحفظ في قاعدة البيانات بنجاح", , "نتيجة عملية الاضافة")
        Me.Close()
        frm1.Show()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
        FRM1.Show()
    End Sub

End Class