Solved

Getting the Value from a Cell in a DataGrid

Posted on 2001-06-22
4
178 Views
Last Modified: 2010-05-02
This is a easy one if you know your DataGrids.

I currently have a ADO Data Control 6.0 and a DataGrid Control 6.0 on one of my forms.

I am trying to access the value of a single cell in the Activity_ID field when the cursor is next to it.

The only way I have figured out how to do this so far is through the use of bookmarks as the Initial Query loads I make every row a bookmark.

Ex.  
 For I = 0 To DataGrid1.VisibleRows - 1
   DataGrid1.SelBookmarks.Add (DataGrid1.RowBookmark(I))
 Next I



 I click a Command Button coded as.....
Ex.

Dim intENum

intENum =
DataGrid1.Columns(0).CellValue(DataGrid1.SelBookmarks(I))

Label6.Caption = intENum
 


So, MY QUESTION is,  can you get this value without the use of bookmarks????

Thank you so much for whoever answers this.

0
Comment
Question by:wmetz
[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
4 Comments
 

Expert Comment

by:nomulap
ID: 6219741
This is how you do it

    intENum = adodc1.recordset("Activity_ID").value


0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 75 total points
ID: 6222304
If you know for sure that the cell has not been changed then normulap's solution would work, otherwise you can use the following:

intENum = CLng(DataGrid1.Columns.Item("Activity_ID ").Text)

Anthony
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7139702
Hi wmetz@devx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Split points between: nomulap and acperkins@devx

wmetz@devx, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7181628
Per recommendation, force-accepted.

Netminder
CS Moderator

nomulap: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20328655
0

Featured Post

Technology Partners: 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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
Suggested Courses
Course of the Month9 days, 16 hours left to enroll

624 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