You are on page 1of 19

REGISTRATION FORM

Private Sub Command1_Click()


Form2.Show
End Sub
Private Sub Command3_Click()
Dim i As Integer
db.Execute ("insert into addstud2 values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text17.Text & "','" & Text6.Text & "','" &
Text7.Text & "','" & Text8.Text & "','" & Combo3.Text & "','" & Combo2.Text & "','"
& Text9.Text & "','" & Text10.Text & "','" & Combo1.Text & "','" & txtfee.Text & "','"
& Text12.Text & "','" & Text16.Text & "','" & Combo4.Text & "')")
MsgBox "data inserted"

End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text17.Text = ""
Text4.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Combo3.Text = ""
Combo2.Text = ""
Text9.Text = ""
Text10.Text = ""
Combo1.Text = ""
txtfee.Text = ""
Text12.Text = ""
Text16.Text = ""
Combo4.Text = ""
MsgBox "enter new data"
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("e:\hostel management\addstud2")
End Sub

DELETE STUDENT
Private Sub Command1_Click()
db.Execute " Delete From ADDSTUD2 WHERE REGID= '" & Text1.Text & "'"
MsgBox "data deleted"
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("e:\hostel management\addstud2")
End Sub
Private Sub Label3_Click()
End Sub
ADD NEW ROOM
Private Sub Command1_Click()
db.Execute ("INSERT INTO ROOMAVA VALUES( '" & Combo1.Text & "','" &
Text3.Text & "','" & Combo2.Text & "')")
MsgBox "DATA INSERT"
Combo1.Text = "-Select-"
Text3.Text = ""
Combo2.Text = "-Select-"
End Sub
Private Sub DataGrid1_Click()
Text4.Text = DataGrid1.Columns.Item(0)
Text5.Text = DataGrid1.Columns.Item(1)
Text6.Text = DataGrid1.Columns.Item(2)

End Sub
Private Sub Command2_Click()
Form3.Show
End Sub

Private Sub Form_Load()


Set db = OpenDatabase("e:\hostel management\ADDSTUD2")

End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
ROOM DETAILS
Private Sub Command1_Click()
If (Adodc1.Recordset.EOF = True) Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveLast
Else
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveFirst
End If
End Sub
Private Sub Form_Load()
End Sub
REPORT MASTER
Private Sub Command1_Click()
DataReport1.Show
End Sub
Private Sub Command2_Click()
DataReport2.Show
End Sub
Private Sub Command3_Click()
DataReport3.Show
End Sub
Private Sub Command4_Click()
DataReport4.Show
End Sub
Private Sub Form_Load()
End Sub

SPLASH FORM
Option Explicit
Private Sub Form_KeyPress(KeyAscii As Integer)
Unload Me
End Sub
Private Sub Form_Load()
lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." &
App.Revision
End Sub
Private Sub Frame1_Click()
Unload Me
End Sub
Private Sub Timer1_Timer()
Line1.X2 = Line1.X2 + Rnd(100 * 9) + 100
If Line1.X2 > 5800 And Line1.X2 < 6000 Then
Form5.Show
Me.Hide
End If
End Sub
Private Sub Timer2_Timer()
If P.Value < 100 Then
P.Value = P.Value + 1

End If
End Sub
LOGIN FORM
Private Sub Command1_Click()
Set rs = db.OpenRecordset("SELECT * FROM LOGIN WHERE USERNAME = '" &
Text1.Text & "'AND PASSWORD = '" & Text2.Text & "' ")
If rs.RecordCount > 0 Then
MsgBox "CORRECT PASSWORD", vbOKCancel
MDIForm1.Show
Me.Hide
Else
MsgBox "WRONG PASSWORD", vbOKCancelonly
End If

End Sub
Private Sub Command2_Click()
End
Unload Me
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("d:\hostel management\addstud2.mdb")
End Sub
LEAVE FORM
Private Sub Command1_Click()
db.Execute ("insert into leave values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Label6.Caption & "','" & Text5.Text & "','"
& Text6.Text & "')")
MsgBox "data inserted"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Form4.Show
End Sub
Private Sub Command4_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
MsgBox "enter new data"
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("e:\hostel management\addstud2")
Label6.Caption = Time
End Sub

MDI FORM
Private Sub addroom_Click(Index As Integer)
Form1.Show
End Sub
Private Sub addstud_Click(Index As Integer)
addstu2.Show
End Sub
Private Sub checkstatus_Click(Index As Integer)
roomavail.Show
End Sub
Private Sub delstud_Click(Index As Integer)
delstudent.Show
End Sub

Private Sub DETAIL_REGIS_Click()


DataReport1.Show
End Sub
Private Sub EXIT_Click()
End
End Sub
Private Sub feedeposit_Click(Index As Integer)
student.Show
End Sub
Private Sub lea_Click()
Form2.Show
End Sub
Private Sub leaveapply_Click(Index As Integer)
lop.Show
End Sub
Private Sub MDIForm_Load()
End Sub
Private Sub REPORT2_Click()
DataReport2.Show
End Sub
Private Sub REPORT3_Click()

DataReport3.Show
End Sub
Private Sub REPORT4_Click()
DataReport4.Show
End Sub
Private Sub returndate_Click(Index As Integer)
report1.Show
End Sub
REPORT RETURN
Private Sub Command1_Click()
Dim rs As Recordset
Set rs = db.OpenRecordset(" select * from leave where name = '" & Text6.Text & "'")
If rs.RecordCount > 0 Then
Text2.Text = rs(1)
Text6.Text = rs(2)
Text5.Text = rs(5)
Text1.Text = rs(0)
Text4.Text = rs(6)
Text3.Text = rs(3)
End If
Text8.Text = DateDiff("d", Date, Text4.Text)
Text9.Text = 20 * Val(Text8.Text)
End Sub
Private Sub Command5_Click()
Adodc1.Recordset.AddNew
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Command7_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Text6.Text = " "
End Sub
Private Sub DataGrid1_Click()
Text1.Text = DataGrid1.Columns.Item(0)
Text2.Text = DataGrid1.Columns.Item(1)
Text3.Text = DataGrid1.Columns.Item(2)

Text6.Text = DataGrid1.Columns.Item(3)
Text5.Text = DataGrid1.Columns.Item(4)
Text4.Text = DataGrid1.Columns.Item(5)
Text8.Text = DataGrid1.Columns.Item(7)
Text9.Text = DataGrid1.Columns.Item(8)
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("e:\hostel management\addstud2")
End Sub
ROOM AVAILABLE
Private Sub Command1_Click()
addstu2.Show
addstu2.Text17.Text = Text2.Text
addstu2.Text1.Text = Text1.Text
End Sub
Private Sub Command2_Click()
Text2.Text = ""
Text1.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.AddNew
End Sub
Private Sub DataGrid1_Click()
Text1.Text = DataGrid1.Columns.Item(0)
Text2.Text = DataGrid1.Columns.Item(1)
Text3.Text = DataGrid1.Columns.Item(2)
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub

STUDENT RECORD
Private Sub Combo1_Change()
End Sub
Private Sub Command1_Click()
db.Execute ("insert into studentfee values ('" & Text1.Text & "','" & Text2.Text & "','"
& Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" &
Text13.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "','" &
Text10.Text & "','" & Text11.Text & "','" & Text12.Text & "')")
MsgBox "data inserted"
End Sub
Private Sub Command2_Click()
Form6.Show
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub DataGrid1_Click()
Text1.Text = DataGrid1.Columns.Item(0)
Text2.Text = DataGrid1.Columns.Item(1)
Text3.Text = DataGrid1.Columns.Item(2)
Text4.Text = DataGrid1.Columns.Item(3)
Text5.Text = DataGrid1.Columns.Item(4)
Text6.Text = DataGrid1.Columns.Item(5)
Combo1.Text = DataGrid1.Columns.Item(6)
Text7.Text = DataGrid1.Columns.Item(7)
Text8.Text = DataGrid1.Columns.Item(8)
Text9.Text = DataGrid1.Columns.Item(9)
Text10.Text = DataGrid1.Columns.Item(10)
Text11.Text = DataGrid1.Columns.Item(11)
Text12.Text = DataGrid1.Columns.Item(12)
End Sub
Private Sub Form_Load()
Set db = OpenDatabase("e:\hostel management\addstud2")
End Sub
Private Sub Label13_Click()
End Sub

You might also like