954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to delete msflexgrid rows which are empty

hi
can u plz let me know how to delete msflexgrid rows which are empty

guru511
Light Poster
42 posts since Jul 2007
Reputation Points: 10
Solved Threads: 3
 

Hi,

Check this Code:

Dim i As Integer
Dim j As Integer
Dim sSQL As String
For i= Grd.Rows-1 To 1 Step -1
  sSQL =""
  For j= 0 to Grd.Cols-1
     sSQL = sSQL & Trim(Grd.TextMatrix(i,j))
  NExt
  If Trim(sSQL) ="" Then
      Grd.RemoveItem i
  End if
  If Grd.rows<=1 Then Exit For
Next


Regards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

Hi Veena

Thanks. Your code works beautifully.

I just replaced "Gird" with my control name.

Julian

tjbvo
Newbie Poster
1 post since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You