Solved

Clear MsFlexgrid

Posted on 2004-04-05
1
1,121 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
[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
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

734 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