Solved

Getting the Value from a Cell in a DataGrid

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

808 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