Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Clearing a flexgrid

Clearing a flexgrid

Clearing a flexgrid


I'm using a command button to run a procedure that adds data from a database to a flexgrid based on criteria from a textbox. I load column headers of the flexgrid in Form_load(). Once this procedure is done and rows have been added to the flexgrid, I want to be able to put different criteria in the textbox and run the procedure again but also clearing the existing data in the grid. I have tried using gridMyGrid.clear but its clearing my column headers and existing rowData and also adding the new rows after the # of rows of previous rowData. Can anyone suggest what to do to clear the grid and keep my headings. The headings are a fixed row. Thanks. Jason

RE: Clearing a flexgrid

You can create a function where you initialize your column headers.
One way you may want to try is grdmygrid.rows = 1 it works sometimes.

RE: Clearing a flexgrid

public sub ClearGrids()
dim a as integer
dim b as integer
with myGrid 'change this to your flexgrid name
.redraw = false
for a = 1 to .rows -1
for b = 1 to .cols -1
.row = a: .col = b: .text = ""
next b
next a
.redraw = true
end with
end sub

this should work for you....let me know if not

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close