Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MSFlexGrid - vb6 deletion of rows

Posted on 1998-12-01
1
Medium Priority
?
262 Views
Last Modified: 2012-06-27
I have used msflexgrid.clear, also a routine to back up the rows within the grid to get to row 1. I have also used
msflexgrid.row = 1, but I always seem to get blank lines, sometimes several, before I start writing within the grid again. Is there magic to get back to row 1 in order to start writing rows again.

This is the routine I have used, it clears the grid, but I get blank lines before I start adding rows again to the grid.

Private Sub cmdRouteAbandon_Click()
Dim K As Integer
On Error GoTo ErrorSection
  'clear grid
   gClrCnt = gClrCnt + 1
   MSFlexGridNewRoute.Row = gClrCnt 'last row
   For K = 1 To gClrCnt
            MSFlexGridNewRoute.Col = 0
            MSFlexGridNewRoute.Text = " "
            MSFlexGridNewRoute.Col = 1
            MSFlexGridNewRoute.Text = " "
            MSFlexGridNewRoute.Col = 2
            MSFlexGridNewRoute.Text = " "
            MSFlexGridNewRoute.Col = 3
            MSFlexGridNewRoute.Text = " "
    If gClrCnt > K Then
        MSFlexGridNewRoute.Row = MSFlexGridNewRoute.Row - 1
    End If
    Next K
    'MSFlexGridNewRoute.Rows =
    SegRteFrom = cboMasterFromZone.
    cboRouteTo.SetFocus
    gClrCnt = 0
    Exit Sub
ErrorSection:
    MsgBox "Error:" & Err & " " & Err.Description
    'will call error program from here errors.vbp
    Exit Sub
End Sub
0
Comment
Question by:MaryD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
dabellei earned 150 total points
ID: 1447637
One thing i do to clear a grid is

' this will clear the grid and reset number of rows
' set the gridrows to the number you want
' it's fast and it's working
msflexgrid.rows=1

msflexgrid.rows=  number_of_rows_you_want



' if you're in a database

do while not data.eof
   ' add a row to the grid
   msflexgrid.rows=msflexgrid.rows+1
   ' position to the last row of the grid
   msflexgrid.row=msflexgrid.rows-1
   'fill in the grid as you wish
   data.movenext
loop




0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question