Solved

Clearing DBGrid

Posted on 1998-12-06
9
340 Views
Last Modified: 2013-12-25
How do you clear an unbound DBGrid after loading it with an array.  The ClearFields method does not work, but that is exactly what I want it to do.  Please help!
0
Comment
Question by:globe
9 Comments
 
LVL 2

Expert Comment

by:majed100598
ID: 1488731
dbgrid1.fixedrows=0
dbgrid.rows=1

then define the number of fixed rows and columns you want
0
 

Author Comment

by:globe
ID: 1488732
There's no FixedRow or Rows property/method for DBGrid in VB5.  
0
 
LVL 3

Expert Comment

by:myqlG
ID: 1488733
he was almost right
dbgrid1.rows=1
dbgrid1.cols=1
(You can try 0 but I think that creates an error)
There is also a dbgrid1.clearfields
good luck
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:globe
ID: 1488734
Again, the Rows property does not apply to DBGrid in VB5, although the Help file claims that it does.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1488735
Maybe it is not an easy question?
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1488736
Ok, so far 10000 points I tell you that DBGrid1.ClearFields might do what you want.
Oeps, I already gave you the answer :-(
0
 

Author Comment

by:globe
ID: 1488737
I stated in my question that  the Clearfields method will give me exactly what I want.  However, I can not make it to work with unbound DBGrid.  In fact, it does nothing.  I found myself a work-around already.  Thanks though.
0
 

Accepted Solution

by:
vinoopauls earned 0 total points
ID: 1488738
redim the array to nothing and refresh the dbgrid
this will clear the unbound dbgrid for you
0
 

Author Comment

by:globe
ID: 1488739
Thank You!  This works!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 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