Private Sub academicstaff_Change()
Me.AcademicStaff = Format(Me.AcademicStaff, "Standard")
End Sub
Private Sub addspic_Click()
If Me.txt4.Value = Empty Then GoTo Noselection
DestFilePath = ThisWorkbook.Path & "\Photo\" & Me.txt4.Value & ".jpg"
Dim FileDig As FileDialog
Set FileDig = Application.FileDialog(msoFileDialogFilePicker)
With FileDig
.AllowMultiSelect = False
.Title = "select a student photo"
.Filters.Clear
.Filters.Add "Picture File", "*.Jpg"
.Filters.Add "All files", "*.*"
If FileDig.Show = -1 Then
SourceFilePath = .SelectedItems(1)
Else
GoTo Noselection
End If
End With
FileCopy SourceFilePath, DestFilePath
Me.student_img.Picture = LoadPicture(DestFilePath)
Me.txt36 = DestFilePath
Noselection:
End Sub
Private Sub BExit_Click()
Unload Me
LoginPage.Show
Sheet2.Range("AF3") = Empty
Me.BExit.BackColor = RGB(255, 192, 0)
End Sub
Private Sub BQuit_Click()
ThisWorkbook.Save
Application.Quit
Me.BQuit.BackColor = RGB(255, 192, 0)
End Sub
Private Sub Btn1_Click()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "Label" Then
If InStr(Ctrl.Name, "Btn") > 0 Then
Ctrl.BackColor = RGB(255, 192, 0)
End If
End If
Me.MultiPage1.Value = 0
Me.Btn1.BackColor = RGB(46, 117, 182)
Me.Label1.Caption = Me.Btn1.Caption
Next
End Sub
Private Sub Btn2_Click()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "Label" Then
If InStr(Ctrl.Name, "Btn") > 0 Then
Ctrl.BackColor = RGB(255, 192, 0)
End If
End If
Me.MultiPage1.Value = 1
Me.Btn2.BackColor = RGB(46, 117, 182)
Me.Label1.Caption = Me.Btn2.Caption
Next
End Sub
Private Sub Btn3_Click()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "Label" Then
If InStr(Ctrl.Name, "Btn") > 0 Then
Ctrl.BackColor = RGB(255, 192, 0)
End If
End If
Me.MultiPage1.Value = 2
Me.Btn3.BackColor = RGB(46, 117, 182)
Me.Label1.Caption = Me.Btn3.Caption
Next
End Sub
Private Sub Btn4_Click()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "Label" Then
If InStr(Ctrl.Name, "Btn") > 0 Then
Ctrl.BackColor = RGB(255, 192, 0)
End If
End If
Me.MultiPage1.Value = 3
Me.Btn4.BackColor = RGB(46, 117, 182)
Me.Label1.Caption = Me.Btn4.Caption
Next
End Sub
Private Sub Btn5_Click()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "Label" Then
If InStr(Ctrl.Name, "Btn") > 0 Then
Ctrl.BackColor = RGB(255, 192, 0)
End If
End If
Me.MultiPage1.Value = 4
Me.Btn5.BackColor = RGB(46, 117, 182)
Me.Label1.Caption = Me.Btn5.Caption
Next
End Sub
Private Sub Btn6_Click()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "Label" Then
If InStr(Ctrl.Name, "Btn") > 0 Then
Ctrl.BackColor = RGB(255, 192, 0)
End If
End If
Me.MultiPage1.Value = 5
Me.btn6.BackColor = RGB(46, 117, 182)
Me.Label1.Caption = Me.btn6.Caption
Next
End Sub
Private Sub Btn7_Click()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "Label" Then
If InStr(Ctrl.Name, "Btn") > 0 Then
Ctrl.BackColor = RGB(255, 192, 0)
End If
End If
Me.MultiPage1.Value = 6
Me.btn7.BackColor = RGB(46, 117, 182)
Me.Label1.Caption = Me.btn7.Caption
Next
End Sub
Private Sub cmbprint_Click()
Application.Dialogs(xlDialogPrinterSetup).Show
ThisWorkbook.Sheets("Sheet6").PrintOut copies:=1
End Sub
Private Sub cmdaddnew_Click()
Dim wks As Worksheet
Dim Addnew As Range
With Sheet6
Set Addnew = Sheet6.Range("A9999").End(xlUp).Offset(1, 0)
Addnew.Offset(0, 2).Value = firstname.Text
Addnew.Offset(0, 3).Value = middlename.Text
Addnew.Offset(0, 4).Value = lastname.Text
If Male.Value = True Then Addnew.Offset(0, 5).Value = "Male"
If Female.Value = True Then Addnew.Offset(0, 5).Value = "Female"
Addnew.Offset(0, 6).Value = DOB.Text
Addnew.Offset(0, 7).Value = telephone.Text
Addnew.Offset(0, 8).Value = address.Text
Addnew.Offset(0, 9).Value = qualifications1.Text
Addnew.Offset(0, 10).Value = qualifications2.Text
If FAAN.Value = True Then Addnew.Offset(0, 11).Value = "FAAN"
If MMA.Value = True Then Addnew.Offset(0, 11).Value = "MMA"
Addnew.Offset(0, 12).Value = cmbposition.Text
Addnew.Offset(0, 13).Value = cmbcategory.Text
Addnew.Offset(0, 14).Value = cmbschool.Text
Addnew.Offset(0, 15).Value = appointment.Text
Addnew.Offset(0, 16).Value = confirmation.Text
Addnew.Offset(0, 17).Value = promotion.Text
Addnew.Offset(0, 18).Value = cmbgrade.Text
Addnew.Offset(0, 19).Value = cmbband.Text
Addnew.Offset(0, 20).Value = hometown.Text
Me.firstname.Value = False
Me.middlename.Value = False
Me.lastnameValue = False
Me.Female.Value = False
Me.Male.Value = False
Me.DOB.Value = False
Me.telephone.Value = False
Me.address.Value = False
Me.qualifications1.Value = False
Me.qualifications2.Value = False
Me.FAAN.Value = False
Me.MMA.Value = False
Me.cmbposition.Value = False
Me.cmbcategory.Value = False
Me.cmbschool.Value = False
Me.appointment.Value = False
Me.confirmation.Value = False
Me.promotion.Value = False
Me.cmbgrade.Value = False
Me.cmbband.Value = False
Me.hometown.Value = False
End With
End Sub
Private Sub cmdExit_Click()
Dim iExit As VbMsgBoxResult
iExit = MsgBox("Confirm if you want to Exit", vbQuestion + vbYesNo, "Staff Data Entry System")
If iExit = vbYes Then
Unload Me
End If
End Sub
Private Sub cmdreset_Click()
Dim txt
For Each txt In Frame2.Controls
If TypeOf txt Is MSForms.TextBox Then
txt.Text = ""
End If
Next txt
txtsearchbx.Text = ""
cmbposition.Text = ""
cmbcategory.Text = ""
cmbgrade.Text = ""
cmbschool.Text = ""
cmbband.Text = ""
Male.Value = False
Female.Value = False
FAAN.Value = False
MMA.Value = False
End Sub
Private Sub cmdsearch_Click()
Dim iSearch As Long, i As Long
iSearch = Worksheets("Sheet6").Range("A1").CurrentRegion.Rows.Count
For i = 1 To iSearch
If Trim(Sheet6.Cells(i, 1)) <> Trim(txtsearchbx.Text) And i = iSearch Then
MsgBox ("invalid data")
txtsearchbx.Text = ""
txtsearchbx.SetFocus
End If
If Trim(Sheet6.Cells(i, 1)) = Trim(Search.Text) Then
EmployeeNo.Text = Sheet6.Cells(i, 1)
staffID.Text = Sheet6.Cells(i, 2)
firstname.Text = Sheet6.Cells(i, 3)
middlename.Text = Sheet6.Cells(i, 4)
lastname.Text = Sheet6.Cells(i, 5)
Female.OptionButton = Sheet6.Cells(i, 6)
DOB.Text = Sheet6.Cells(i, 7)
telephone.Text = Sheet6.Cells(i, 8)
address.Text = Sheet6.Cells(i, 9)
qualifications1.Text = Sheet6.Cells(i, 10)
qualifications2.Text = Sheet6.Cells(i, 11)
MMA.OptionButton = Sheet6.Cells(i, 12)
Position.Text = Sheet6.Cells(i, 13)
Category.Text = Sheet6.Cells(i, 14)
appointment.Text = Sheet6.Cells(i, 15)
confirmation.Text = Sheet6.Cells(i, 16)
promotion.Text = Sheet6.Cells(i, 17)
grade.Text = Sheet6.Cells(i, 18)
band.Text = Sheet6.Cells(i, 19)
hometown.Text = Sheet6.Cells(i, 20)
Exit For
End If
Next i
End Sub
Private Sub CommandButton6_Click()
End Sub
Private Sub Delete_Click()
Dim i As Integer
For i = 0 To Range("A55356").End(xlUp).Row - 1
If Lstdisplay.Selected(i) Then
Rows(i + 1).Select
Selection.Delete
End If
Next i
End Sub
Private Sub fee1_Change()
Dim Itm As ListItem
On Error Resume Next
ClsRow = Sheet1.Range("Class").Find(Me.fee1.Text, , xlValues, xlWhole).Row
For ColNo = 2 To 19
If ColNo > 1 And ColNo < 17 Then
Me("fee" & ColNo) = Format(Sheet1.Cells(ClsRow, ColNo).Value, "Standard")
Else
Me("fee" & ColNo) = Sheet1.Cells(ClsRow, ColNo).Value
End If
Next ColNo
End Sub
Private Sub fee10_AfterUpdate()
Me.fee10 = Format(Me.fee10.Value, "Standard")
End Sub
Private Sub fee11_AfterUpdate()
Me.fee11 = Format(Me.fee11.Value, "Standard")
End Sub
Private Sub fee12_AfterUpdate()
Me.fee12 = Format(Me.fee12.Value, "Standard")
End Sub
Private Sub fee13_AfterUpdate()
Me.fee13 = Format(Me.fee13.Value, "Standard")
End Sub
Private Sub fee14_AfterUpdate()
Me.fee14 = Format(Me.fee14.Value, "Standard")
End Sub
Private Sub fee15_AfterUpdate()
Me.fee15 = Format(Me.fee15.Value, "Standard")
End Sub
Private Sub fee16_AfterUpdate()
Me.fee16 = Format(Me.fee16.Value, "Standard")
End Sub
Private Sub fee17_AfterUpdate()
Me.fee17 = Format(Me.fee17.Value, "Standard")
End Sub
Private Sub fee18_AfterUpdate()
Me.fee18 = Format(Me.fee18.Value, "Standard")
End Sub
Private Sub fee19_AfterUpdate()
Me.fee19 = Format(Me.fee19.Value, "MM/DD/YYYY")
End Sub
Private Sub fee2_AfterUpdate()
Me.fee2 = Format(Me.fee2.Value, "Standard")
End Sub
Private Sub fee3_AfterUpdate()
Me.fee3 = Format(Me.fee3.Value, "Standard")
End Sub
Private Sub fee4_AfterUpdate()
Me.fee4 = Format(Me.fee4.Value, "Standard")
End Sub
Private Sub fee5_AfterUpdate()
Me.fee5 = Format(Me.fee5.Value, "Standard")
End Sub
Private Sub fee6_AfterUpdate()
Me.fee6 = Format(Me.fee6.Value, "Standard")
End Sub
Private Sub fee7_AfterUpdate()
Me.fee7 = Format(Me.fee7.Value, "Standard")
End Sub
Private Sub fee8_AfterUpdate()
Me.fee8 = Format(Me.fee8.Value, "Standard")
End Sub
Private Sub fee9_AfterUpdate()
Me.fee9 = Format(Me.fee9.Value, "Standard")
End Sub
Private Sub FEEDETAIL_Click()
Set StuList = Sheet2.Range("Adm_No").Find(Me.txt1.Value, , xlValues, xlWhole)
If StuList Is Nothing Then
MsgBox ("Please Select Student")
GoTo Noselection
Else
stuRow = StuList.Row
End If
For StuCol = 20 To 34
Me("Rec" & StuCol - 17) = Sheet2.Cells(stuRow, StuCol)
Next StuCol
Noselection:
End Sub
Private Sub feesave_Click()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "TextBox" Or TypeName(Ctrl) = "Combobox" Then
If InStr(Ctrl.Name, "fee") > 0 And Ctrl = Empty Then
MsgBox ("All Field Mandatory")
GoTo NoAction
End If
End If
Next
On Error GoTo NoAction
ClsRow = Sheet1.Range("Class").Find(Me.fee1.Value, , xlValues, xlWhole).Row
For ColNo = 2 To 19
Sheet1.Cells(ClsRow, ColNo) = Me("fee" & ColNo).Value
Next ColNo
Set Itm = Me.mylistview.FindItem(Me.fee1.Value, lvwText, , lvwPartial)
Me.mylistview.ListItems(Itm.Index).Selected = True
indx = Me.mylistview.SelectedItem.Index
For MyCol = 1 To 18
Me.mylistview.ListItems.Item(indx).SubItems(MyCol) = Me("fee" & MyCol + 1).Text
Next MyCol
MsgBox ("Fee Successfully Added")
NoAction:
End Sub
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
StdIndex = Me.ListBox1.ListIndex + 4
StdReg = Sheet2.Range("AX" & StdIndex)
StdRow = Sheet2.Range("ADM_No").Find(StdReg, , xlValues, xlWhole).Row
For StdCol = 1 To 39
Me("txt" & StdCol) = Sheet2.Cells(StdRow, StdCol).Value
Next StdCol
On Error Resume Next
Me.student_img.Picture = LoadPicture(Me.txt36)
Sheet3.Range("V2") = Val(Me.txt1)
Sheet3.Range("W2") = Me.txt38
FilterReceipt
Me.ListBox2.RowSource = "Receipt"
Me.txt40 = Application.WorksheetFunction.Sum(Sheet3.Range("AV2:AV999"))
End Sub
Private Sub ListBox2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
With Sheet3
RecRow = .Range("C:C").Find(Me.ListBox2.Column(0), , xlValues, xlWhole).Row
For RecCol = 3 To 19
Me("Rec" & RecCol - 2) = .Cells(RecRow, RecCol)
Next RecCol
End With
End Sub
Private Sub MultiPage1_Change()
End Sub
Private Sub mylistview_ItemClick(ByVal Item As MSComctlLib.ListItem)
indx = Me.mylistview.SelectedItem.Index
Me.fee1.Value = Me.mylistview.ListItems(indx)
End Sub
Private Sub NEWRECORD_Click()
For Ctrl = 1 To 18
Me("Rec" & Ctrl) = ""
Next Ctrl
If Sheet3.Range("C2") = Empty Then
Me.Rec1 = 1
Else
Me.Rec1 = Application.WorksheetFunction.Max(Sheet3.Range("C:C")) + 1
End If
Me.Rec2 = Date
End Sub
Private Sub Rec2_Change()
Me.Rec2 = Format(Me.Rec2.Value, "DD/MM/YYYY")
End Sub
Private Sub Rec3_Change()
Me.Rec3 = Format(Me.Rec3.Value, "Standard")
If Me.Rec3 = Empty Then
Me.Rec3 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec4_Change()
Me.Rec4 = Format(Me.Rec4.Value, "Standard")
If Me.Rec4.Value = Empty Then
Me.Rec4.Value = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec5_Change()
Me.Rec5 = Format(Me.Rec5.Value, "Standard")
If Me.Rec5 = Empty Then
Me.Rec5 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec6_Change()
Me.Rec6 = Format(Me.Rec6.Value, "Standard")
If Me.Rec6 = Empty Then
Me.Rec6 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec7_Change()
Me.Rec7 = Format(Me.Rec7.Value, "Standard")
If Me.Rec7 = Empty Then
Me.Rec7 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec8_Change()
Me.Rec8 = Format(Me.Rec8.Value, "Standard")
If Me.Rec8 = Empty Then
Me.Rec8 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec9_Change()
Me.Rec9 = Format(Me.Rec9.Value, "Standard")
If Me.Rec9 = Empty Then
Me.Rec9 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec10_Change()
Me.Rec10 = Format(Me.Rec10.Value, "Standard")
If Me.Rec10 = Empty Then
Me.Rec10 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec11_Change()
Me.Rec11 = Format(Me.Rec11.Value, "Standard")
If Me.Rec11 = Empty Then
Me.Rec11 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec12_Change()
Me.Rec12 = Format(Me.Rec12.Value, "Standard")
If Me.Rec12 = Empty Then
Me.Rec12 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec13_Change()
Me.Rec13 = Format(Me.Rec13.Value, "Standard")
If Me.Rec13 = Empty Then
Me.Rec13 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec14_Change()
Me.Rec14 = Format(Me.Rec14.Value, "Standard")
If Me.Rec14 = Empty Then
Me.Rec14 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec15_Change()
Me.Rec15 = Format(Me.Rec15.Value, "Standard")
If Me.Rec15 = Empty Then
Me.Rec15 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec16_Change()
Me.Rec16 = Format(Me.Rec16.Value, "Standard")
If Me.Rec16 = Empty Then
Me.Rec16 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec17_Change()
Me.Rec17 = Format(Me.Rec17.Value, "Standard")
If Me.Rec17 = Empty Then
Me.Rec17 = 0
End If
On Error Resume Next
Me.Rec18 = Int(Me.Rec3) + Int(Me.Rec4) + Int(Me.Rec5) + Int(Me.Rec6) + Int(Me.Rec7) + Int(Me.Rec8) + Int(Me.Rec9) + Int(Me.Rec10) + Int(Me.Rec11) + Int(Me.Rec12) + Int(Me.Rec13) + Int(Me.Rec14) + Int(Me.Rec15) + Int(Me.Rec16) + Int(Me.Rec17)
End Sub
Private Sub Rec18_Change()
Me.Rec18 = Format(Me.Rec18.Value, "Standard")
End Sub
Private Sub RECPRINT_Click()
If Me.Rec1 = Empty Then GoTo Noselection
With Sheet4
.
End With
Noselection:
End Sub
Private Sub RECSAVE_Click()
With Sheet3
If Me.Rec1 = "" Then GoTo NoData
Set RecNo = Sheet3.Range("C:C").Find(Me.Rec1, , xlValues, xlWhole)
If RecNo Is Nothing Then
RecRow = Sheet3.Range("A99999").End(xlUp).Row + 1
Else
RecRow = RecNo.Row
End If
Sheet3.Cells(RecRow, "A") = Val(Me.txt1)
Sheet3.Cells(RecRow, "B") = Me.txt36
For RecCol = 3 To 20
Sheet3.Cells(RecRow, RecCol) = Me("Rec" & RecCol - 2).Value
Next RecCol
Sheet3.Range("V2") = Val(Me.txt1)
Sheet3.Range("W2") = Me.txt36
FilterReceipt
Me.ListBox2.RowSource = "Receipt"
End With
NoData:
End Sub
Private Sub SpinButton1_Change()
With Sheet6
Dim c1, c2
If SpinButton1.Value > 0 Then
c2 = SpinButton1.Value
c1 = "A" & c2
EmployeeNo.ControlSource = c1
c1 = "B" & c2
staffID.ControlSource = c1
c1 = "C" & c2
firstname.ControlSource = c1
c1 = "D" & c2
middlename.ControlSource = c1
c1 = "E" & c2
lastname.ControlSource = c1
c1 = "F" & c2
gender.ControlSource = c1
c1 = "G" & c2
DOB.ControlSource = c1
c1 = "H" & c2
telephone.ControlSource = c1
c1 = "I" & c2
address.ControlSource = c1
c1 = "J" & c2
qualifications1.ControlSource = c1
c1 = "K" & c2
qualifications2.ControlSource = c1
c1 = "L" & c2
Status.ControlSource = c1
c1 = "M" & c2
cmbposition.ControlSource = c1
c1 = "N" & c2
cmbcategory.ControlSource = c1
c1 = "O" & c2
appointment.ControlSource = c1
c1 = "P" & c2
confirmation.ControlSource = c1
c1 = "Q" & c2
promotion.ControlSource = c1
c1 = "R" & c2
cmbgrade.ControlSource = c1
c1 = "S" & c2
cmbband.ControlSource = c1
c1 = "T" & c2
hometown.ControlSource = c1
End If
End With
End Sub
Private Sub student_img_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub StudentAdd_Click()
If Sheet2.Range("A4") = Empty Then
Me.txt1 = 1
Else
Me.txt1 = Application.WorksheetFunction.Max(Range("Adm_No")) + 1
End If
For StdCol = 2 To 39
Me("txt" & StdCol) = ""
Next StdCol
Me.txtsearch = ""
End Sub
Private Sub StudentSave_Click()
If Me.txt1.Value = Empty Or Me.txt5.Value = Empty Or Me.txt2.Value = Empty Then
MsgBox ("First Click Add button and Enter Atleast Student name and Class to save Data")
GoTo NoAction
End If
Set StdRow = Sheet2.Range("Adm_No").Find(Me.txt1.Value, , xlValues, xlWhole)
If StdRow Is Nothing Then
AvailRow = Sheet2.Range("A99999").End(xlUp).Row + 1
Else
AvailRow = StdRow.Row
End If
For StdCol = 1 To 39
Sheet2.Cells(AvailRow, StdCol) = Me("txt" & StdCol).Value
Next StdCol
MsgBox ("Student Profile Successfully Updated")
NoAction:
Me.txtsearch = ""
Sheet1.Range("AV3") = Empty
FilterClass
Me.ListBox1.RowSource = "StudentName"
End Sub
Private Sub txt2_Change()
Sheet2.Range("AO4") = Me.txt2.Value
FilterClass
On Error Resume Next
Me.ListBox1.RowSource = "Studentname"
If Sheet2.Range("AR4") = Empty Then
Me.txt10 = 1
Else
Me.txt10 = Application.WorksheetFunction.CountA(Range("Std")) + 1
End If
End Sub
Private Sub txt20_Change()
Me.txt20 = Format(Me.txt20, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt21_Change()
Me.txt21 = Format(Me.txt21, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt22_Change()
Me.txt22 = Format(Me.txt22, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt23_Change()
Me.txt23 = Format(Me.txt23, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt24_Change()
Me.txt24 = Format(Me.txt24, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt25_Change()
Me.txt25 = Format(Me.txt25, "Standard")
On Error Resume Next
Me.txt35 = Me.txt20 + Me.txt21 + Me.txt22 + Me.txt23 + Me.txt24 + Me.txt25 + Me.txt26 + Me.txt27 + Me.txt28 + Me.txt29 + Me.txt30 + Me.txt31 + Me.txt32 + Me.txt33 + Me.txt34 + Me.txt39
End Sub
Private Sub txt26_Change()
Me.txt26 = Format(Me.txt26, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt27_Change()
Me.txt27 = Format(Me.txt27, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt28_Change()
Me.txt28 = Format(Me.txt28, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt29_Change()
Me.txt29 = Format(Me.txt29, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt30_Change()
Me.txt30 = Format(Me.txt30, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt31_Change()
Me.txt31 = Format(Me.txt31, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt32_Change()
Me.txt32 = Format(Me.txt32, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt33_Change()
Me.txt33 = Format(Me.txt33, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt34_Change()
Me.txt34 = Format(Me.txt34, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt35_Change()
Me.txt35 = Format(Me.txt35, "Standard")
End Sub
Private Sub txt39_Change()
Me.txt39 = Format(Me.txt39, "Standard")
On Error Resume Next
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
End Sub
Private Sub txt40_Change()
Me.txt40 = Format(Me.txt40, "Standard")
End Sub
Private Sub txt41_Change()
Me.txt41 = Format(Me.txt41, "Standard")
Me.txt40 = Format(Me.txt40, "Standard")
Me.txt41 = Me.txt35 - Me.txt40
End Sub
Private Sub txtsearch_Change()
Sheet2.Range("AV4") = "*" & Me.txtsearch & "*"
FilterClass
Me.ListBox1.RowSource = "studentname"
End Sub
Private Sub UserForm_Activate()
Me.creche = Sheet6.Range("AG2").Value
Me.nursery = Sheet6.Range("AH2").Value
Me.primary = Sheet6.Range("AI2").Value
Me.junior = Sheet6.Range("AJ2").Value
Me.senior = Sheet6.Range("AK2").Value
Me.AcademicStaff = Int(Me.creche) + Int(Me.nursery) + Int(Me.primary) + Int(Me.junior) + Int(Me.senior)
End Sub
Private Sub UserForm_Initialize()
For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "Label" Then
If InStr(Ctrl.Name, "Btn") > 0 Then
Ctrl.BackColor = RGB(255, 192, 0)
End If
End If
Next
Me.Btn1.BackColor = RGB(46, 117, 182)
Me.MultiPage1.Value = 0
Me.Image1.Picture = LoadPicture(Sheet1.Range("E6"))
On Error Resume Next
Dim Rowlist As ListItem
Me.mylistview.ForeColor = RGB(75, 142, 213)
With Me.mylistview
For ColHead = 1 To 19
mylistview.ColumnHeaders.Add , , Sheet1.Cells(15, ColHead).Value, 170
If ColHead >= 1 And ColHead < 17 Then
mylistview.ColumnHeaders(ColHead).Alignment = lvwColumnRight
End If
Next ColHead
For RowItm = 16 To 54
Set Rowlist = .ListItems.Add(, , Sheet1.Cells(RowItm, 1).Value)
For RowCol = 2 To 19
If RowCol > 1 And RowCol < 17 Then
Rowlist.ListSubItems.Add , , Format(Sheet1.Cells(RowItm, RowCol), "Standard")
Else
Rowlist.ListSubItems.Add , , Sheet1.Cells(RowItm, RowCol)
End If
Next RowCol
Next RowItm
End With
MyYear = Year(Date)
For Itm = -10 To 10
Me.txt38.AddItem MyYear + Itm & "-" & MyYear + Itm + 1
Next Itm
MyYear = Year(Date)
For Itm = -10 To 10
Me.fee17.AddItem MyYear + Itm & "-" & MyYear + Itm + 1
Next Itm
Male.Value = False
MMA.Value = False
Lstdisplay.ColumnCount = 21
Lstdisplay.RowSource = Sheet6.Range("A2:U99999")
Me.lbdate.Caption = Format(Date, "ddd, d mmm yyyy")
Me.promotionlistacad.AllowColumnReorder = True
For ColHead = 1 To 13
Me.promotionlistacad.ColumnHeaders.Add , , Sheet5.Cells(4, ColHead), 150
Next ColHead
For RowItm = 5 To Sheet5.Range("A99999").End(xlUp).Row
Set Rowlist = Me.promotionlistacad.ListItems.Add(, , Sheet5.Cells(RowItm, 1))
Me.txt20 = 0
Me.txt21 = 0
Me.txt22 = 0
Me.txt23 = 0
Me.txt24 = 0
Me.txt25 = 0
Me.txt26 = 0
Me.txt27 = 0
Me.txt28 = 0
Me.txt29 = 0
Me.txt30 = 0
Me.txt31 = 0
Me.txt32 = 0
Me.txt33 = 0
Me.txt34 = 0
Me.txt32 = 0
Me.txt33 = 0
Me.txt34 = 0
Me.txt39 = 0
For ColItm = 2 To 13
Rowlist.ListSubItems.Add , , Sheet5.Cells(RowItm, ColItm)
If Sheet5.Cells(RowItm, 5) <= 0 Then
Rowlist.ListSubItems(4).ForeColor = vbRed
End If
If Sheet5.Cells(RowItm, 5) > 29 Then
Rowlist.ListSubItems(4).ForeColor = vbGreen
End If
If Sheet5.Cells(RowItm, 5) <= 29 Then
Rowlist.ListSubItems(4).ForeColor = vbBlue
End If
If Sheet5.Cells(RowItm, 8) <= 0 Then
Rowlist.ListSubItems(7).ForeColor = vbRed
End If
If Sheet5.Cells(RowItm, 8) > 29 Then
Rowlist.ListSubItems(7).ForeColor = vbGreen
End If
If Sheet5.Cells(RowItm, 8) <= 29 Then
Rowlist.ListSubItems(7).ForeColor = vbBlue
End If
If Sheet5.Cells(RowItm, 11) <= 0 Then
Rowlist.ListSubItems(10).ForeColor = vbRed
End If
If Sheet5.Cells(RowItm, 11) > 0 Then
Rowlist.ListSubItems(10).ForeColor = vbGreen
End If
Next ColItm
Next RowItm
Sheet3.Range("Y2:AV9999").ClearContents
Mainform.EmployeeNo.Value = ActiveCell.Offset(0, 1).Value
Mainform.staffID.Value = ActiveCell.Offset(0, 2).Value
Mainform.firstname.Value = ActiveCell.Offset(0, 3).Value
Mainform.middlename.Value = ActiveCell.Offset(0, 4).Value
Mainform.lastname.Value = ActiveCell.Offset(0, 5).Value
Mainform.gender.Value = ActiveCell.Offset(0, 6).Value
Mainform.DOB.Value = ActiveCell.Offset(0, 7).Value
Mainform.telephone.Value = ActiveCell.Offset(0, 8).Value
Mainform.address.Value = ActiveCell.Offset(0, 9).Value
Mainform.qualifications1.Value = ActiveCell.Offset(0, 10).Value
Mainform.qualifications2.Value = ActiveCell.Offset(0, 11).Value
Mainform.cmbposition.Value = ActiveCell.Offset(0, 12).Value
Mainform.cmbcategory.Value = ActiveCell.Offset(0, 13).Value
Mainform.cmbschool.Value = ActiveCell.Offset(0, 14).Value
Mainform.appointment.Value = ActiveCell.Offset(0, 15).Value
Mainform.confirmation.Value = ActiveCell.Offset(0, 16).Value
Mainform.cmbgrade.Value = ActiveCell.Offset(0, 17).Value
Mainform.cmbband.Value = ActiveCell.Offset(0, 18).Value
Mainform.hometown.Value = ActiveCell.Offset(0, 19).Value
End Sub
Private Sub GetFee_Click()
If Me.txt20.Value <> Empty Then
MsgBox ("Student Fee Already Filled. Do you want to reset the Fee Structure?." & vbCrLf & " Please delete all the fee section then try again")
GoTo NoClass
End If
If Me.txt2 = Empty Then
MsgBox ("Please Select Class")
GoTo NoClass
End If
On Error Resume Next
ClsRow = Sheet1.Range("Class").Find(Me.txt2.Text, , xlValues, xlWhole).Row
For FeeDtl = 2 To 16
Me("txt" & FeeDtl + 18) = Sheet1.Cells(ClsRow, FeeDtl)
Next FeeDtl
Me.txt40 = 0
Me.txt35 = Int(Me.txt20) + Int(Me.txt21) + Int(Me.txt22) + Int(Me.txt23) + Int(Me.txt24) + Int(Me.txt25) + Int(Me.txt26) + Int(Me.txt27) + Int(Me.txt28) + Int(Me.txt29) + Int(Me.txt30) + Int(Me.txt31) + Int(Me.txt32) + Int(Me.txt33) + Int(Me.txt34) + Int(Me.txt39)
NoClass:
End Sub