Solved

Setting grid cell text

Posted on 1997-12-10
4
351 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

758 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

18 Experts available now in Live!

Get 1:1 Help Now