Solved

Deleting last non-fixed row in MSFlexGrid

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

737 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