Solved

Deleting last non-fixed row in MSFlexGrid

Posted on 1999-01-13
2
1,782 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now