Solved

Setting grid cell text

Posted on 1997-12-10
4
357 Views
Last Modified: 2012-05-04
What code should I use to set cell text for either a grid control or a DBgrid control, the following does not seem to work:
DbGridName.Columns(1).CellValue ("text")  nor
DbGridName.Columns(1).CellText ("text")
0
Comment
Question by:ncw
[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
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
leeal earned 100 total points
ID: 1444634
Grid:
Grid1.text = "Data for the current cell"

DBGrid:
DBGrid1.Columns(1).Text = "Text to be displayed in the cell"
DBGrid1.Columns(1).Text = "Data to be contained in the cell"

0
 
LVL 1

Author Comment

by:ncw
ID: 1444635
Yes, got that to work with 'Grid' but an error message says "this property not available" for 'DBGrid', does it need to be the 32-bit version?
0
 
LVL 1

Expert Comment

by:leeal
ID: 1444636
umm.... not sure...
What I suggest is to make sure that you have typed (for DBGrid):
   DBGrid1.Columns(1).Text = "whatever"
instead of:
   DBGrid1.Text = "whatever"

where 'Columns' is a collection of the columns in the grid, and the number within the parenthesis is the index of the column.
- DBGrid1.Columns(0) is first column
- DBGrid1.Columns(1) is 2nd column, etc...

btw, I mistyped something in my answer for DBGrid. It should be:
DBGrid1.Columns(1).Text = "Text to be displayed in the cell"
DBGrid1.Columns(1).Value = "Data to be contained in the cell"

sorry... :p
0
 
LVL 1

Author Comment

by:ncw
ID: 1444637
Thanks for your comment. I understand your code, but for some reason the message still appears - "the object does not support this property"
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

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…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

732 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