Solved

Clear MsFlexgrid

Posted on 2004-04-05
1
1,114 Views
Last Modified: 2013-12-25
hello Experts,

How do I replace the data in an MsFlexgrid with new data at runtime.

at the moment I am doing this;

Private Sub Option1_Click(index As Integer)
    MsFlexgrid1.Clear
    Call AssignPlayers1
    MsFlexgrid1.Cols = rec.Fields.count
   
  With rec
    Do While Not .EOF
        MsFlexgrid1.AddItem vbTab & .Fields(0) & vbTab & .Fields(1) & vbTab & .Fields(2) & vbTab & .Fields(3) & vbTab & .Fields(4) 'until your last fields....
        .MoveNext
    Loop
  End With

this clears the first set of data already there, then loads new data, but the initials rows are not removed, even though the data has been cleared.

thank you.
end sub
0
Comment
Question by:claracruz
1 Comment
 
LVL 18

Accepted Solution

by:
Sethi earned 125 total points
ID: 10758890
To remove rows you have to set .Rows property. Example after you clear all data set MsFlexgrid1.Rows=2
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

821 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