Voting System Essay

Custom Student Mr. Teacher ENG 1001-04 18 March 2016

Voting System

Dim rowx As Integer, colx As Integer
Dim rs As New ADODB.Recordset
Dim con As New ADODB.Connection

Public Sub connectdbase()

If con.State = 0 Then
con.Open “Provider=Microsoft.Jet.OLEDB.4.0;” _
& “Data Source=” & App.Path & “\database\ccvvfvc.mdb” End If

End Sub

Sub setupFlex()
With MSFlexGrid1
.Rows = 2
.Cols = 10
.RowHeightMin = 315

.TextMatrix(0, 1) = “Student No”
.TextMatrix(0, 2) = “Student Name”
.TextMatrix(0, 3) = “Prelim”
.TextMatrix(0, 4) = “Midterm”
.TextMatrix(0, 5) = “Prefinal”
.TextMatrix(0, 6) = “Final”
.TextMatrix(0, 7) = “Subject Grade”
.TextMatrix(0, 8) = “PTS. Equivalent”
.TextMatrix(0, 9) = “Remarks”

.ColWidth(0) = 800
.ColWidth(1) = 1000
.ColWidth(2) = 2000
.ColWidth(3) = 1000
.ColWidth(4) = 1000
.ColWidth(5) = 1000
.ColWidth(6) = 1000
.ColWidth(7) = 2000
.ColWidth(8) = 2000
.ColWidth(9) = 1500

End With
End Sub

Private Sub cmdAdd_Click()
MSFlexGrid1.AddItem “”
End Sub

Private Sub Form_load()
setupFlex
connectdbase

Set rs = con.Execute(“Select studentNo,studname from tblstudentinfo”) If Not rs.EOF Then
While Not rs.EOF
With MSFlexGrid1
.TextMatrix(.Rows – 1, 1) = rs.Fields(0)
.TextMatrix(.Rows – 1, 2) = rs.Fields(1)

rs.MoveNext
.AddItem “”
End With
Wend
End If
End Sub

Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
rowx = MSFlexGrid1.Row
colx = MSFlexGrid1.Col

If KeyAscii = 13 Then
If colx >= 3 And colx <= 6 Then
With TxtInput
.Left = MSFlexGrid1.CellLeft + MSFlexGrid1.Left
.Top = MSFlexGrid1.CellTop + MSFlexGrid1.Top
.Width = MSFlexGrid1.CellWidth
.Height = MSFlexGrid1.CellHeight
.Text = MSFlexGrid1.Text
.Visible = True
.SetFocus
End With
End If
End If

End Sub

Private Sub TxtInput_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
With MSFlexGrid1
.TextMatrix(rowx, colx) = TxtInput.Text
TxtInput.Visible = False
computegrade

End With
End If
End Sub

Private Sub TxtInput_LostFocus()
TxtInput_KeyPress 13
End Sub

Sub computegrade()
prelim = Val(MSFlexGrid1.TextMatrix(rowx, 3))
midterm = Val(MSFlexGrid1.TextMatrix(rowx, 4))
Prefinal = Val(MSFlexGrid1.TextMatrix(rowx, 5))
Final = Val(MSFlexGrid1.TextMatrix(rowx, 6))
subjgrade = Val(prelim + midterm + Prefinal + Final) / 4 MSFlexGrid1.TextMatrix(rowx, 7) = subjgrade
End Sub

Sub equivalent()
MSFlexGrid1.TextMatrix(rowx, 8) = PTSEquivalent

End Sub

Sub remarks()
MSFlexGrid1.TextMatrix(rowx, 9) = remarks
End Sub

Free Voting System Essay Sample

B

We will write a custom essay sample on Voting System

for only $16.38 $12.9/page

your testimonials