Solved

Clearing DBGrid

Posted on 1998-12-06
9
334 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 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

19 Experts available now in Live!

Get 1:1 Help Now