Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Deleting rows in a grid

Posted on 1999-07-30
Medium Priority
Last Modified: 2010-04-30
I have flexgrid that adds rows to it based on what the user needs.  ANyways, once that info is brought up I need to have possibly a command button that deletes all the current rows to do the process over again.  ( I don't want to just clear the rows!)  What can I do to do this.  Thanks.

Question by:valvoj
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
  • 3
  • 2
LVL 14

Expert Comment

ID: 1528516


Author Comment

ID: 1528517
I need to be able to delete the rows, not just clear the contents of the grid

Expert Comment

ID: 1528518
Use sendkey function to delete the selected row


SendKeys "{DEL}", True
Independent Software Vendors: 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!


Author Comment

ID: 1528519

I want to delete all the rows in a grid after a command has been run with a command button.  I'm not looking to select certain rows.

Accepted Solution

EDDYT earned 40 total points
ID: 1528520
For i = MSHFlexGrid1.Rows - 1 To 2 Step -1
   MSHFlexGrid1.RemoveItem i

Author Comment

ID: 1528521
Thanks for the help EDDYT!!

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Suggested Courses

705 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