Solved

MsFlexGrid Delete Last Row

Posted on 2004-03-20
3
343 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
  • 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

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