Solved

MsFlexGrid Delete Last Row

Posted on 2004-03-20
3
344 Views
Last Modified: 2013-12-25
Two quick and possible easy questions,

I can't delete the last row of my msflexgrid
It says Can not delete the last non-fixed row
Run time error 30015

here is my code

Private Sub Delete_click()
tablegrid.RemoveItem (tablegrid.Rowsel)

Secondly
How can i make it where multiple rows are selected they will all be deleted.
0
Comment
Question by:neutrinohunter
[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
3 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 10642612
There should be minimum one row in a flexgrid at any point of time and this is its inbuilt design. You will have to ensure error handlers in your code for this error if you provide row deletion functionality in your code.
0
 
LVL 5

Accepted Solution

by:
jayeshshah earned 30 total points
ID: 10645797
try this code below for deleting the 1st row.

If MSFlexGrid1.Rows = 0 Then Exit Sub
    If (MSFlexGrid1.Rows - MSFlexGrid1.FixedRows) <= 1 Then
        MSFlexGrid1.Rows = MSFlexGrid1.Rows - 1
    Else
        MSFlexGrid1.RemoveItem MSFlexGrid1.RowSel
    End If


 Regards

JBS
0
 
LVL 5

Expert Comment

by:jayeshshah
ID: 10657878
thanx for the 'B' grade .... :-(
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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

732 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