STUDENTS FORM
CODINGS:
Dim db As Database
Dim rs As Recordset
Dim flag As Integer
Private Sub Form_Load()
Set db = OpenDatabase("C:\Documents and Settings\Administrator\Desktop\
dbms.mdb")
Set rs = db.OpenRecordset("student")
MsgBox "connected"
Text1.Text = rs("sno")
Text2.Text = rs("sname")
Text3.Text = rs("mark1")
Text4.Text = rs("mark2")
Text5.Text = rs("total")
Text6.Text = rs("avg")
Text7.Text = rs("result")
End Sub
Private Sub CALCULATE_Click()
Text5.Text = Val(Text3.Text) + Val(Text4.Text)
Text6.Text = Val(Text5.Text) / 2
If Val(Text3.Text) > 25 And Val(Text4.Text) > 25 Then
Text7.Text = "PASS"
Else
Text7.Text = "FAIL"
End If
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()
Dim x As String
x = MsgBox("do u want to delete?", vbYesNo, "delete")
If x = vbYes Then
MsgBox "deleted"
rs.DELETE
Else
MsgBox "not deleted"
End If
End Sub
Private Sub INSERT_Click()
rs.AddNew
End Sub
Private Sub SAVE_Click()
If rs.EditMode = dbEditAdd Then
rs("Sno") = Text1.Text
rs("sname") = Text2.Text
rs("mark1") = Text3.Text
rs("mark2") = Text4.Text
rs("total") = Text5.Text
rs("avg") = Text6.Text
rs("result") = Text7.Text
End If
rs.UPDATE
MsgBox "record added"
End Sub
Private Sub UPDATE_Click()
Adodc1.Recordset(0) = Text1.Text
Adodc1.Recordset(1) = Text2.Text
Adodc1.Recordset(2) = Text3.Text
Adodc1.Recordset(3) = Text4.Text
Adodc1.Recordset(4) = Text5.Text
Adodc1.Recordset(5) = Text6.Text
Adodc1.Recordset(6) = Text7.Text
Adodc1.Recordset.UPDATE
End Sub
Form Design:
Student Form with Record Added message:
Student Form with Deleted message:
Student Form with Input Data:
Student Form with Calculation of Total, Average and Result:
EMPLOYEE PAYROLL PROCESSING
CODINGS:
Dim db As Database
Dim rs As Recordset
Private Sub Form_Load()
Set db = opendatabase("C:\Documents and Settings\Administrator\Desktop\
employee.mdb")
Set rs = db.openrecordset("employee")
MsgBox "connected"
End Sub
Private Sub Insert_Click()
rs.addnew
End Sub
Private Sub Save_Click()
If rs.EditMode = dbEditAdd Then
rs("Eno") = Text1.Text
rs("Ename") = Text2.Text
rs("edept") = Text3.Text
rs("ejob") = Text4.Text
rs("basic") = Text5.Text
rs("pf") = Text6.Text
rs("da") = Text7.Text
rs("hra") = Text8.Text
rs("gross sal") = Text9.Text
rs("net sal") = Text10.Text
End If
rs.Update
MsgBox "record added"
End Sub
Private Sub Calculate_Click()
Text9.Text = Val(Text5.Text) + Val(Text7.Text) + Val(Text8.Text)
Text10.Text = Val(Text9.Text) - Val(Text6.Text)
End Sub
Private Sub Clear_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub
Form Design:
Employee Form with Input Entries:
Employee Form with Salary Calculation:
Employee Form with Record Added message:
LIBRARY MANAGEMENT SYSTEM
CODINGS:
Form 1:
Dim db As Database
Dim rs As Recordset
Private Sub Form_Load()
Set db = opendatabase("C:\Documents and Settings\NSIT\My Documents\
lib.mdb")
Set rs = db.openrecordset("lib")
MsgBox "connected"
End Sub
Private Sub Save_Click()
If rs.EditMode = dbEditAdd Then
rs("code") = Text1.Text
rs("desc") = Text2.Text
rs("total") = Text3.Text
End If
rs.Update
End Sub
Private Sub Insert_Click()
rs.AddNew
End Sub
Private Sub Next_Click()
Form2.Show
End Sub
Form 2:
Dim db As Database
Dim rs As Recordset
Private Sub Form_Load()
Set db = opendatabase("C:\Documents and Settings\NSIT\My Documents\
lib.mdb")
Set rs = db.openrecordset("lib1")
MsgBox "connected"
End Sub
Private Sub Insert_Click()
rs.AddNew
End Sub
Private Sub Delete_Click()
Dim xs As String
xs = MsgBox("Do u want to delete?", vbYesNo, "delete")
If xs = vbYes Then
rs.Delete
MsgBox "deleted"
Else
MsgBox "not deleted"
End If
End Sub
Private Sub Save_Click()
If rs.EditMode = dbEditAdd Then
rs("acno") = Text1.Text
rs("author") = Text2.Text
rs("price") = Text3.Text
rs("sno") = Text4.Text
rs("btitle") = Text5.Text
rs("publication") = Text6.Text
rs("status") = Text7.Text
End If
rs.Update
End Sub
Private Sub Next_Click()
Form3.Show
End Sub
Form 3:
Dim db As Database
Dim rs As Recordset
Private Sub Form_Load()
Set db = opendatabase("C:\Documents and Settings\NSIT\My Documents\
lib.mdb")
Set rs = db.openrecordset("lib2")
MsgBox "connected"
End Sub
Private Sub Insert_Click()
rs.AddNew
End Sub
Private Sub Save_Click()
If rs.EditMode = dbEditAdd Then
rs("tno") = Text1.Text
rs("sname") = Text2.Text
rs("tdate") = Text3.Text
rs("sno") = Text4.Text
rs("acno") = Text5.Text
rs("ttype") = Text6.Text
rs.Update
End Sub
Design Form 1:
Design Form 2:
Design Form 3:
Save the data :
Insert the data: