sample
Haven't found the Essay You Want?
For Only $12.90/page

Voting System Essay

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


Essay Topics:


Sorry, but copying text is forbidden on this website. If you need this or any other sample, we can send it to you via email. Please, specify your valid email address

We can't stand spam as much as you do No, thanks. I prefer suffering on my own

Courtney from Study Moose

Hi there, would you like to get such a paper? How about receiving a customized one? Check it out https://goo.gl/3TYhaX