Solved

Deleting last non-fixed row in MSFlexGrid

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

691 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