Solved

Clearing DBGrid

Posted on 1998-12-06
9
336 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON Response and request in VB6 application 11 230
Determine Range to Select 5 42
How does CurrentUser work? 10 31
VBA Shell can't Find Word document 11 73
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

943 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

5 Experts available now in Live!

Get 1:1 Help Now