Transcript Programming Language
Login Coding
Const PassValue = “group4“
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdOK_Click()
Dim k As String
k = txtPassword.Text
If k <> “” Then
If k = PassValue Then
Me.Hide
Main.Show vbModal
‘ frmMain.Hide
Else
MsgBox “Sorry! Wrong Password”, vbCritical + vbOKOnly, “Security”
txtPassword.SetFocus
txtPassword.Text = “”
End If
End If
End Sub
Private Sub Form_Load()
txtUserName.Text = “Group 4″
MsgBox “Press Enter to go Login! Welcome from The System”, vbInformation + vbOKOnly, “To Entry for The Program”
End Sub
Const PASSVAL = “g4″
Public objConn As ADODB.Connection
Public recFS As New ADODB.Recordset
Public strsql As String
Private Sub ado1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
ado1.Caption = ado1.Recordset.AbsolutePosition & ” of ” & ado1.Recordset.RecordCount
End Sub
Private Sub cboMajor_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtRegNo.SetFocus
End If
End Sub
Cover Coding
Dim Tm As Boolean
Option Explicit
Dim A As String
Dim t As String
Dim b As Integer
Dim i As Integer
Public FS As Integer
Dim inter As Long
Const PASSVAL = “group4″
Private Sub cmdCancel_Click()
fraPW.Visible = False
fraStart.Visible = True
End Sub
Private Sub cmdClose_Click()
End
End Sub
Private Sub cmdOK_Click()
If txtPW.Text <> “” Then
If txtPW.Text = PASSVAL Then
Unload Me
Main.Visible = True
Else
MsgBox “Sorry! Invalid password”, vbExclamation + vbOKOnly
txtPW.SetFocus
End If
End If
End Sub
Private Sub cmdStart_Click()
fraStart.Visible = False
fraPW.Visible = True
txtPW.Text = “”
txtPW.SetFocus
txtUser.Text = “Group-4″
End Sub
Private Sub Form_Load()
On Error Resume Next
‘ Shape1.Shape = 4
‘CheckAgain
”————-
Tm = True
End Sub
Private Sub Timer1_Timer(Index As Integer)
t = Left(A, b)
‘Form1.Caption = t
b = b + 1
If b > i Then b = 0
End Sub
Private Sub txtPW_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdOK_Click
End If
End Sub
Main Form Coding
Dim Tm As Boolean
Option Explicit
Dim A As String
Dim t As String
Dim b As Integer
Dim i As Integer
Public FS As Integer
Private Sub Form_Load()
On Error Resume Next
‘ Shape1.Shape = 4
CheckAgain
”————-
Tm = True
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
Main.PopupMenu mnuEntry
End If
End Sub
Private Sub mnuApplicant_Click()
frmDataUpdating.fraApp.Visible = False
frmDataUpdating.fraChk.Visible = True
frmDataUpdating.cmdSave.Visible = True
frmDataUpdating.Show vbModal
End Sub
Private Sub mnuBlue_Click()
‘Report.Show vbModal
End Sub
Private Sub mnuClose_Click()
End
End Sub
Private Sub mnuFirst_Click()
If cboMaj.ListIndex = -1 Then
MsgBox “Select the specialization!”, vbInformation, “Warning”
Exit Sub
End If
If cboAyr.ListIndex = -1 Then
MsgBox “Select the academic year!”, vbInformation, “Warning”
Exit Sub
End If
FirstYear.Show vbModal
End Sub
Private Sub mnuForm_Click()
‘frmDataUpdating.fraApp.Visible = True
‘frmDataUpdating.fraChk.Visible = False
‘frmDataUpdating.cmdSave.Visible = False
frmFlexForm.Show vbModal
End Sub
Private Sub mnuFst_Click()
If cboMaj.ListIndex = -1 Then
MsgBox “Select the specialization!”, vbInformation, “Warning”
Exit Sub
End If
If cboAyr.ListIndex = -1 Then
MsgBox “Select the academic year!”, vbInformation, “Warning”
Exit Sub
End If
Dim objConn As ADODB.Connection
Dim recRpt As New ADODB.Recordset
Dim strsql As String
Set objConn = New ADODB.Connection
Set recRpt = New ADODB.Recordset
strsql = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & App.Path & “\Marks.mdb;Persist Security Info=False”
objConn.Open strsql
If recRpt.State = 1 Then recRpt.Close
strsql = “Delete * from tblRpt”
recRpt.Open strsql, objConn, adOpenDynamic, adLockOptimistic
strsql = “Select * from tblRpt”
recRpt.Open strsql, objConn, adOpenDynamic, adLockOptimistic
recRpt.AddNew
recRpt!RegNo = cboMaj.Text
recRpt!Ayr = cboAyr.Text
recRpt.Update
recRpt.Close
FS = 1
‘ frmBlueSheet.Show vbModal
‘If Main.FS = 1 Then
crtReport.ReportFileName = App.Path & “\Report\rptFstBS.rpt”
‘ ElseIf FS = 2 Then
‘ End If
crtReport.WindowShowRefreshBtn = True
crtReport.WindowState = crptMaximized
crtReport.Action = 1
End Sub
Private Sub mnuSec_Click()
If cboMaj.ListIndex = -1 Then
MsgBox “Select the specialization!”, vbInformation, “Warning”
Exit Sub
End If
If cboAyr.ListIndex = -1 Then
MsgBox “Select the academic year!”, vbInformation, “Warning”
Exit Sub
End If
Dim objConn As ADODB.Connection
Dim recRpt As New ADODB.Recordset
Dim strsql As String
Set objConn = New ADODB.Connection
Set recRpt = New ADODB.Recordset
strsql = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & App.Path & “\Marks.mdb;Persist Security Info=False”
objConn.Open strsql
If recRpt.State = 1 Then recRpt.Close
strsql = “Delete * from tblRpt”
recRpt.Open strsql, objConn, adOpenDynamic, adLockOptimistic
strsql = “Select * from tblRpt”
recRpt.Open strsql, objConn, adOpenDynamic, adLockOptimistic
recRpt.AddNew
recRpt!RegNo = cboMaj.Text
recRpt!Ayr = cboAyr.Text
recRpt.Update
recRpt.Close
FS = 2
crtReport.ReportFileName = App.Path & “\Report\rptSecBS.rpt”
crtReport.WindowShowRefreshBtn = True
crtReport.WindowState = crptMaximized
crtReport.Action = 1
End Sub
Private Sub mnuSecond_Click()
If cboMaj.ListIndex = -1 Then
MsgBox “Select the specialization!”, vbInformation, “Warning”
Exit Sub
End If
If cboAyr.ListIndex = -1 Then
MsgBox “Select the academic year!”, vbInformation, “Warning”
Exit Sub
End If
frmSecondYear.Show vbModal
End Sub
Private Sub mnuStudent_Click()
‘StudentData.Show vbModal
End Sub
Private Sub Picture2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
Main.PopupMenu mnuEntry
End If
End Sub
Private Sub tmrTitle_Timer()
‘t = Left(A, b)
‘Main.Caption = t
‘b = b + 1
‘If b > i Then b = 0
tmrTitle.Enabled = False
End Sub
Sub CheckAgain()
A = “WELCOME FROM EXAMINATION AND CONVOCATION DEPARTMENT, PAKOKKU UNIVERSITY”
i = Len(A)
b = 0
End Sub
First Year Marks Entry
Private Sub cmdCancel_Click()
On Error Resume Next
ado1.Recordset.CancelBatch
ado1.Refresh
ado1.Recordset.Filter = “Major Like ‘” & Main.cboMaj.Text & “‘ and AcademicYear Like ‘” & Main.cboAyr.Text & “‘”
Call OnButtons
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDel_Click()
Dim s As String
s = MsgBox(“Are You Sure, DELETE This Record?”, vbQuestion + vbYesNo, “Quiting?”)
If s = vbYes Then
ado1.Recordset.Delete
ado1.Refresh
ado1.Recordset.Filter = “Major Like ‘” & Main.cboMaj.Text & “‘ and AcademicYear Like ‘” & Main.cboAyr.Text & “‘”
Else
Exit Sub
End If
End Sub
Private Sub cmdEdit_Click()
On Error Resume Next
Dim Str As String
Str = InputBox(“Enter password to edit”, “Group-4″)
If Str <> “” Then
If Str = PASSVAL Then
ado1.Recordset.Update
Call OffButtons
Else
MsgBox “sorry!Invalid password”, vbExclamation
End If
End If
Combo1.SetFocus
End Sub
Private Sub cmdFind_Click()
On Error Resume Next
Dim Str As String
Str = InputBox(“Enter the RollNo you want to find”, “Finding With RollNo!”)
If Str <> “” Then
ado1.Recordset.Filter = “RollNo LIKE ‘*” & Str & “*’ and AcademicYear Like ‘” & Main.cboAyr.Text & “‘”
If ado1.Recordset.EOF Then
MsgBox “Not found”
ado1.Recordset.Filter = “”
End If
Else
ado1.Recordset.Filter = “”
End If
End Sub
Private Sub cmdNew_Click()
On Error Resume Next
SSTab1.Tab = 0
ado1.Recordset.AddNew
Call OffButtons
End Sub
Private Sub cmdRef_Click()
On Error Resume Next
ado1.Refresh
ado1.Recordset.Filter = “Major Like ‘” & Main.cboMaj.Text & “‘ and AcademicYear Like ‘” & Main.cboAyr.Text & “‘”
OnButtons
End Sub
Private Sub cmdReport_Click()
‘ Report.Show vbModal
End Sub
Private Sub cmdSave_Click()
If recFS.State = 1 Then recFS.Close
strsql = “Select * From FirstYExam where UniRegiNo = ‘” & txtRegNo.Text & “‘ and AcademicYear = ‘” & lblAyr.Caption & “‘”
recFS.Open strsql, objConn, adOpenDynamic, adLockOptimistic
If recFS.BOF And recFS.EOF Then
ado1.Recordset.Fields(“Major”) = lblMaj.Caption
ado1.Recordset.Fields(“AcademicYear”) = lblAyr.Caption
ado1.Recordset.Fields(“TotalGP”) = Val(txtFGPT.Text) + Val(txtSGPT.Text)
ado1.Recordset.UpdateBatch
Call OnButtons
Else
Debug.Print recFS.Fields(1)
MsgBox “Check Reg.No, It is already exist”, vbInformation, “Check Reg.No”
txtRegNo.SetFocus
End If
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtName.SetFocus
End If
End Sub
Private Sub Combo4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtT2.SetFocus
End If
End Sub
Private Sub OffButtons()
cmdNew.Enabled = False
cmdEdit.Enabled = False
cmdDel.Enabled = False
cmdFind.Enabled = False
cmdClose.Enabled = False
cmdRef.Enabled = False
cmdSave.Enabled = True
cmdCancel.Enabled = True
End Sub
Private Sub OnButtons()
cmdNew.Enabled = True
cmdEdit.Enabled = True
cmdDel.Enabled = True
cmdFind.Enabled = True
cmdClose.Enabled = True
cmdRef.Enabled = True
cmdSave.Enabled = False
cmdCancel.Enabled = False
End Sub
Private Sub Combo5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtT3.SetFocus
End If
End Sub
Private Sub Form_Load()
SSTab1.Tab = 0
Set objConn = New ADODB.Connection
Set recFS = New ADODB.Recordset
strsql = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & App.Path & “\Marks.mdb;Persist Security Info=False”
objConn.Open strsql
lblMaj.Caption = Main.cboMaj.Text
lblAyr.Caption = Main.cboAyr.Text
ado1.Recordset.Filter = “Major Like ‘” & Main.cboMaj.Text & “‘ and AcademicYear Like ‘” & Main.cboAyr.Text & “‘”
End Sub
Private Sub txt1GP_KeyPress(KeyAscii As Integer)
Dim A As Integer
A = Val(txtFMT.Text)
If Not IsNumeric(txtFMT.Text) Then
Val (txtFMT.Text) / 4
End If
If KeyAscii = 13 Then
If txtGP1 > 2 And txtGP2 > 2 And txtGP3 > 2 And txtGP4 > 2 Then
txt1RM.Text = “Passed”
Else
txt1RM.Text = “Failed”
End If
End If
txt1RM.SetFocus
End Sub
Private Sub txtFGPT_KeyPress(KeyAscii As Integer)
Dim A As Integer
A = Val(txtFGPT.Text)
txt1GP.Text = A / 4
End Sub
Private Sub txtFMT_GotFocus()
If IsNumeric(txtT1.Text) = True And IsNumeric(txtT2.Text) = True And IsNumeric(txtT3.Text) = True And IsNumeric(txtT4.Text) = True Then
txt1GP = Val(txtFGPT) / 4
‘ txt1GP = (Val(txtCU1) * Val(txtGP1)) + (Val(txtCU2) * Val(txtGP2)) + (Val(txtCU3) * Val(txtGP3)) + (Val(txtCU4) * Val(txtGP4)) / Val(txtFCUT)
‘txt1GP = Format(txt1GP, “fixed”)
End If
If IsNumeric(txtT1.Text) = False Or IsNumeric(txtT2.Text) = False Or IsNumeric(txtT3.Text) = False Or IsNumeric(txtT4.Text) = False Then
txt1RM.Text = “Incomplete”
Else
txt1RM.Text = “”
End If
End Sub
Private Sub txt1RM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SSTab1.Tab = 1
Combo2.SetFocus
End If
End Sub
Private Sub txt2GP_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtGPA.Text = (Val(txt1GP.Text) + Val(txt2GP.Text)) / 2
End If
txtGPA.SetFocus
End Sub
Private Sub txtFMT_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt1GP = Val(txtFGPT) / 4
‘txt1GP = Format(txt1GP, “fixed”)
End If
txt1GP.SetFocus
End Sub
Private Sub txtMarkTotal_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtGPA.Text = Val(txtGPTotal) / 4
‘ txtGPA.Text = Format(txtGPA.Text, “fixed”)
txtGPA.SetFocus
End If
End Sub
Private Sub txtGPA_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txtGP8 > 2 And txtGP9 > 2 And txtGP10 > 2 And txtGP11 > 2 Then
txtRemark.Text = “Passed”
Else
txtRemark.Text = “Failed”
End If
End If
txtRemark.SetFocus
End Sub
Private Sub txtname_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtRollNo.SetFocus
End If
End Sub
Private Sub txtPF_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtRemark.SetFocus
End If
End Sub
Private Sub txtRegNo_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo3.SetFocus
End If
End Sub
Private Sub txtRollNo_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If ado1.Recordset.Fields(3) = txtRollNo.Text Then
MsgBox “Already exist Roll Number”
txtRollNo.SetFocus
Else
txtRegNo.SetFocus
End If
End If
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtT1.SetFocus
End If
End Sub
Private Sub txtSGPT_KeyPress(KeyAscii As Integer)
Dim A As Integer
A = Val(txtSGPT.Text)
End Sub
Private Sub txtSTM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt2GP = Val(txtSGPT) / 4
‘txt2GP = Format(txt2GP, “fixed”)
End If
txt2GP.SetFocus
End Sub
Private Sub txtRemark_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If txt1RM.Text = “Passed” And txtRemark.Text = “Passed” Then
txtPF.Text = “Passed”
Else
txtPF.Text = “Failed”
End If
MsgBox “Are you Sure want to Save?”, vbQuestion + vbYesNo, “Saving”
If vbYes Then
cmdSave_Click
End If
End If
End Sub
Private Sub txtSupply_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtRemark.SetFocus
End If
End Sub
Private Sub txtT1_Change()
If Val(txtT1) > 100 Then
MsgBox “Invalid Number”
End If
End Sub
Private Sub txtT1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtFMT.Text = Val(txtT1)
txtFCUT.Text = Val(txtCU1)
txtFGPT.Text = Val(txtGP1)
Combo4.SetFocus
End If
End Sub
Private Sub txtT1_KeyUp(KeyCode As Integer, Shift As Integer)
Dim mk, b As Integer
mk = Val(txtT1.Text)
If Not IsNumeric(txtT1.Text) Then
txtGP1.Text = txtT1.Text
End If
If IsNumeric(txtT1.Text) Then
Select Case mk
Case Is < 0
MsgBox “less then 0″, vbCritical + vbOKOnly, “Exam:Error”
Case Is = “A”
txtCU1.Text = “A”
txtGP1.Text = “A”
Case Is = 0
txtCU1.Text = “0″
txtGP1.Text = “0″
Case 1 To 64
txtCU1.Text = “4″
txtGP1.Text = “2″
Case 65 To 74
txtCU1.Text = “4″
txtGP1.Text = “3″
Case 75 To 100
txtCU1.Text = “4″
txtGP1.Text = “4″
‘Case Is >= “75″
‘txtCU1.Text = “4″
‘txtGP1.Text = “4″
Case Is > 101
MsgBox “Greater than 100″, vbCritical + vbOKOnly, “Exam:Error”
txtCU1.Text = “”
txtGP1.Text = “”
txtT1.Text = “”
txtFMT.SetFocus
End Select
End If
End Sub
Private Sub txtT2_Change()
If Val(txtT2) > 100 Then
MsgBox “Invalid Number”
End If
End Sub
Private Sub txtT2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtFMT.Text = Val(txtT1) + Val(txtT2)
txtFCUT.Text = Val(txtCU1) + Val(txtCU2)
txtFGPT.Text = Val(txtGP1) + Val(txtGP2)
Combo5.SetFocus
End If
End Sub
Private Sub txtT2_KeyUp(KeyCode As Integer, Shift As Integer)
Dim mk, b As Integer
mk = Val(txtT2.Text)
If Not IsNumeric(txtT2.Text) Then
txtGP2.Text = txtT2.Text
End If
If IsNumeric(txtT2.Text) Then
Select Case mk
Case Is < 0
MsgBox “less then 0″, vbCritical + vbOKOnly, “Exam:Error”
Case Is = “A”
txtCU2.Text = “A”
txtGP2.Text = “A”
Case Is = 0
txtCU2.Text = “0″
txtGP2.Text = “0″
Case 1 To 64
txtCU2.Text = “4″
txtGP2.Text = “2″
Case 65 To 74
txtCU2.Text = “4″
txtGP2.Text = “3″
Case 75 To 100
txtCU2.Text = “4″
txtGP2.Text = “4″