Title:
Author:
Publisher:
Year:
Category:
and save the table as booktitle.mdb
Design the Interface as follow:
Key in the codes as follows:
Private Sub cmdCancel_Click()txtTitle.Text = ""
txtAuthor.Text = ""
txtPublisher.Text = ""
txtYear.Text = ""
txtCategory.Text = ""
End Sub
Private Sub cmdDelete_Click()
Confirm = MsgBox("Are you sure you want to delete this record?", vbYesNo, "Deletion Confirmation")
If Confirm = vbYes Then
adoLibrary.Recordset.Delete
MsgBox "Record Deleted!", , "Message"
Else
MsgBox "Record Not Deleted!", , "Message"
End If
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdNew_Click()
adoLibrary.Recordset.AddNew
End Sub
Private Sub cmdNext_Click()
If Not adoLibrary.Recordset.EOF Then
adoLibrary.Recordset.MoveNext
If adoLibrary.Recordset.EOF Then
adoLibrary.Recordset.MovePrevious
End If
End If
End Sub
Private Sub cmdPrevious_Click()
If Not adoLibrary.Recordset.BOF Then
adoLibrary.Recordset.MovePrevious
If adoLibrary.Recordset.BOF Then
adoLibrary.Recordset.MoveNext
End If
End If
End Sub
Private Sub cmdSave_Click()
adoLibrary.Recordset.Fields("Title") = txtTitle.Text
adoLibrary.Recordset.Fields("Author") = txtAuthor.Text
adoLibrary.Recordset.Update
End Sub
No comments:
Post a Comment