Private Sub Form_Load() Dim lSprIdx As Long Dim nCnt As Integer Dim nFileNum As Integer Dim nMsgNo As Integer Dim aLine As String Dim aMsgInf As String Dim aSplit() As String Dim aRead() As String Me.Caption = m_CapName + " my form" nCnt = 0 nFileNum = FreeFile Open DSP_FILE For Input As #nFileNum Do Until EOF(nFileNum) ReDim Preserve aRead(nCnt) Line Input #nFileNum, aLine aRead(nCnt) = aLine nCnt = nCnt + 1 Loop Close nFileNum spdTbl.Row = m_DspIdx spdTbl.Col = 1 spdTbl.Action = 0 spdTbl.SelModeSelected = True With spdTbl .ReDraw = False For lSprIdx = 1 To nCnt - 1 Call SplitCSVData(aRead(lSprIdx), aSplit) nMsgNo = Trim(Str(aSplit(0))) aMsgInf = aSplit(1) .Row = lSprIdx .Col = 1 .Text = nMsgNo .Col = 2 .Text = aMsgInf Next lSprIdx .Row = 0: .Row2 = 0 .Col = 0: .Col2 = .MaxCols .ForeColor = &H0& .BlockMode = True .Font.Bold = True .BlockMode = False .Row = 1 .Col = 1 If spdTbl.ActiveRow = 1 Then .SelModeSelected = True End If .ReDraw = True End With spdTbl.MaxRows = lSprIdx - 1 Erase aSplit Erase aRead End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)