?
Solved

Getting the Value from a Cell in a DataGrid

Posted on 2001-06-22
4
Medium Priority
?
180 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 300 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 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

719 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