Solved

Deleting last non-fixed row in MSFlexGrid

Posted on 1999-01-13
2
1,842 Views
Last Modified: 2008-03-03
I am using MSFlexGrid in VB5.0 to display an Access database. I've set the first row of the grid to be 'fixed' in order to display the column headers. However, when I tried to remove the last non-fixed row in the grid, I get an error: "Runtime error 30015: Cannot remove last non-fixed row" . I've decided to include a check in my code so that whenever I have only one non-fixed row left, I use the Clear method instead of the RemoveItem method. Is there a better way around it?
0
Comment
Question by:meko
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
traygreen earned 50 total points
ID: 1456104
Rather than use the removeitem method, implicitly set the number of rows to get rid of the last item.  That way you do not have to reset the formatstring as after a clear.
0
 
LVL 3

Expert Comment

by:traygreen
ID: 1456105
EG of above...
will leave just the header row....
Private Sub Command1_Click()
   MSFlexGrid1.Rows = 1
End Sub

will leave the header row + 1 blank row...
Private Sub Command2_Click()
   MSFlexGrid1.Rows = 1
   MSFlexGrid1.Rows = 2
End Sub
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

830 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