Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to kill empty columns!!

Posted on 1998-10-13
1
Medium Priority
?
148 Views
Last Modified: 2010-04-30
My position is that I have a DBGRID with all sorts of columns and information in it.  

Lets say the DBGRID has an empty column, ie. no data in that column.

How do I figure this out (through code) and delete the column, or at least hide it?

Thanks.
0
Comment
Question by:MarkA
[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
1 Comment
 
LVL 3

Accepted Solution

by:
vmano earned 400 total points
ID: 1439771
here is how:
this code finds you the contents of a cell in a DBGrid control

Dim igColumn As Integer
Dim igRow As Integer
Dim vargBookmark As Variant
 
      Private Sub DBGrid1_MouseUp(Button As Integer, Shift As Integer, _
                                  X As Single, Y As Single)
         igColumn = DBGrid1.ColContaining(X)   'Set the Cell Column number
         igRow = DBGrid1.RowContaining(Y)      'Set the Cell Row number
 
         vargBookmark = DBGrid1.RowBookmark(igRow) 'Set Bookmark Value
 
         'Show the contents of the cell in a textbox
         Text1.Text = DBGrid1.Columns(igColumn).CellValue(vargBookmark)

after you get the Text1.Text, set the CurrentCellVisible property of the DBGrid control.

let me know if this helps,
vmano
0

Featured Post

Independent Software Vendors: 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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses

610 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