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 +