You are on page 1of 6

LIBRARY MANAGEMENT SYSTEM

MAIN FORM Private Sub BOOK_Click() Form2.Show End Sub Private Sub EXIT_Click() Unload Me End Sub

BOOK ISSUE FORM

Dim rs As Recordset Dim db As Database Private Sub display() Text1.Text = rs!stuid Text2.Text = rs!Name Text3.Text = rs!Year Text4.Text = rs!br Text5.Text = rs!bname Text6.Text = rs!author Text7.Text = rs!datiss End Sub Private Sub ADD_Click() rs.AddNew rs!stuid = Text1.Text rs!Name = Text2.Text rs!Year = Text3.Text rs!br = Text4.Text rs!bname = Text5.Text rs!author = Text6.Text rs!datiss = Text7.Text rs.Update MsgBox "ADDED", vbInformation, "ADDED" End Sub

Private Sub CLEAR_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text7.Text = "" End Sub Private Sub DELETE_Click() rs.DELETE rs.MoveFirst End Sub Private Sub EXIT_Click() Unload Me End Sub Private Sub FIRST_Click() rs.MoveFirst display End Sub Private Sub Form_Load() Set db = OpenDatabase("D:\cse\lib.mdb") Set rs = db.OpenRecordset("libmgmt", dbOpenDynaset) End Sub Private Sub LAST_Click() rs.MoveLast display End Sub Private Sub MODIFY_Click() rs.Edit End Sub Private Sub NEXT_Click() rs.MoveNext If rs.EOF Then MsgBox "this is last record" rs.MoveLast End If display

End Sub Private Sub PREV_Click() rs.MovePrevious If rs.BOF Then MsgBox "this is first record" rs.MoveFirst End If display End Sub Private Sub SAVE_Click() rs.Edit rs!stuid = Text1.Text rs!Name = Text2.Text rs!Year = Text3.Text rs!br = Text4.Text rs!bname = Text5.Text rs!author = Text6.Text rs!datiss = Text7.Text rs.Update MsgBox "SAVE", vbInformation, "SAVE" End Sub Private Sub SEARCH_Click() Dim opt As Double If rs.EOF And rs.BOF Then MsgBox "record not found" Exit Sub End If opt = InputBox("enter the emp no") rs.MoveFirst While rs.EOF = False If Trim(opt) = Trim(rs!stuid) Then display Exit Sub Else rs.MoveNext End If Wend MsgBox "record not found" End Sub

OUTPUT

You might also like