Dim con As New ADODB.Connection Dim rs As New ADODB.Recordset Private Sub Command1_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" rs.AddNew End Sub Private Sub Command3_Click() rs("Bookid") = Text1.Text rs("Bookname") = Text2.Text rs("Authname") = Text3.Text rs("Pub") = Text4.Text rs("price") = Text5.Text rs.Update MsgBox "One record is inserted in the table", vbInformation, "Message" End Sub End Sub Private Sub Command4_Click() rs.MoveFirst Call navigate End Sub Private Sub Command5_Click() rs.MoveNext If (rs.EOF = True) Then rs.MoveLast MsgBox "This is last record", vbInformation, "Message" End If Call navigate End Sub Private Sub Command6_Click() rs.MovePrevious If (rs.BOF = True) Then rs.MoveFirst MsgBox "This is a first record", vbInformation, "Message" End If Call navigate End Sub Private Sub command7_Click() rs("Bookid") = Text1.Text rs("Bookname") = Text2.Text rs("Authname") = Text3.Text rs("Pub") = Text4.Text rs("price") = Text5.Text rs.Update MsgBox "Record has been updated", vbInformation, "Message" rs.MoveNext If rs.EOF = True Then rs.MovePrevious End If Call navigate End Sub Private Sub FIRST_Click() End Sub Private Sub Form_Load() Set con = New ADODB.Connection Set rs = New ADODB.Recordset Adodc1.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=LIBRARY.mdb;Persist Security Info=False" Adodc1.RecordSource = "select * from LIB" End Sub Private Sub navigate() Text1.Text = rs("Bookid") Text2.Text = rs("Bookname") Text3.Text = rs("Authname") Text4.Text = rs("Pub") Text5.Text = rs("price") End Sub Private Sub last_Click() rs.MoveLast Call navigate End Sub Private Sub NEXT_Click() End Sub Private Sub previous_Click() End Sub