Solved

Getting the Value from a Cell in a DataGrid

Posted on 2001-06-22
4
172 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
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

744 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

11 Experts available now in Live!

Get 1:1 Help Now