Insert Values into Table

     

     

    Private Sub CMDInsertValues_Click()
    'www.Tricks12345.com
    Dim db As Database
    Set db = CurrentDb
    Dim tblname As String
    tblname = Me.TxtBox.Value
    db.Execute "Insert into " & tblname & " Values(1, 'Apple', 150, 6, 'Hyderabad')"
    db.Execute "Insert into " & tblname & " Values(2, 'Banana', 165, 15, 'Banglore')"
    MsgBox ("Hi Pavan Inserted Values into table")
    End Sub