Solved

Clear MsFlexgrid

Posted on 2004-04-05
1
1,082 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
Comment Utility
To remove rows you have to set .Rows property. Example after you clear all data set MsFlexgrid1.Rows=2
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now