Solved

DBGRID LOCKED

Posted on 1998-10-01
3
163 Views
Last Modified: 2006-11-17
I know this must be easy but here it goes.  I have a db grid that I am running various sql statements as data1 recordsource.  This works fine. all I really want to be able to do is at one point make the datagrid so it is not bound to a datacontrol by pressing a button or by using a if then statement, etc

I would like to do this so i can make the datagrid blank, also I want to make it so the table in the database is not bound to any control in VB.  

Idea's?
0
Comment
Question by:CURIOUS1
[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
  • 3
3 Comments
 
LVL 3

Accepted Solution

by:
TheAnswerMan earned 50 total points
ID: 1437656
You can use the GetRows function of an RDO Resultset to pass the resultset into an Array.

then the Grid Will be blank until you decide that you want to fill it with data.

It is a simple matter of using a Do while Loop to Build the Grid as you like.

dim x as long
dim li_Row as Long
Dim li_Col as integer

x = UBound(TheArray(2))-1  'The number of columns
                          'Do This here instead of inside
                          'first loop, otherwise VB has to
                          'Calculate the 'RowCount' for every row

For y = 0 to UBound(TheArray(1))
   For li_col = 0 to x      
     'Assign Whatever Cell you want = TheArray(li_Row,li_col)
   Next y
Next y
0
 
LVL 3

Expert Comment

by:TheAnswerMan
ID: 1437657
The other King thing about the Unbound it that it doesn't add an extra connection<For Each Data Control> to the Server, since these connections arent free.  If your app is multi user.. this can make a big difference.  
Also, since you don't have to open a new connectiont to the database for a Control, Your form probably will load faster, making for a snappy appearance.
0
 
LVL 3

Expert Comment

by:TheAnswerMan
ID: 1437658
The other King thing about the Unbound it that it doesn't add an extra connection<For Each Data Control> to the Server, since these connections arent free.  If your app is multi user.. this can make a big difference.  
Also, since you don't have to open a new connectiont to the database for a Control, Your form probably will load faster, making for a snappy appearance.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

739 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