al4629740
asked on
selected values from a datagrid in VB6
In VB6, is there a way to select a record from a datagrid and use the values in that record for coding. For example, if you see the selected row in the attached image, I would like to use the values in the first few columns (Agency, ActivityName, etc...) How would I select the values after the user has selected the row from the review grid?
image.jpg
image.jpg
Something like MyDataGrid.Rows(1).Cells(0 ).Value
ASKER
Trying it now
ASKER
Ok, so how would the program distinguish between a row selected vs. one that is not?
You can probably do this
MyDataGrid.Rows(MyDataGrid .Row).Cell s(0).Value
MyDataGrid.Rows(MyDataGrid
ASKER
Method or data member not found on this line where highlighted in bold
LocateDate = DataGrid1.Rows(DataGrid1.Row).Cells(3).V alue
My guess is syntax?
LocateDate = DataGrid1.Rows(DataGrid1.Row).Cells(3).V
My guess is syntax?
ASKER
The name of my Datagrid is datagrid1 so there is no error in the name of the grid.
DataGrid1.Rows(DataGrid1. SelectedRow).Cells(3).Valu e
ASKER
DataGrid1.Rows(DataGrid1. SelectedRow).Cells(3).Value
Same error on the bold above
Same error on the bold above
Would it be possible for you to create a zip file of your project (including the database if you're using one) and attach it?
ASKER
Sent
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Give me some time on this and I'll report back.
Give me some time on this and I'll report back.
ASKER
So what you gave me certainly works...I'm just trying to convert that to my application. Its taking a little time.
I’m glad I was able to help.
If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.
Marty - Microsoft MVP 2009 to 2017
Experts Exchange Most Valuable Expert (MVE) 2015, 2017
Experts Exchange Top Expert Visual Basic Classic 2012 to 2018
Experts Exchange Top Expert VBA 2018
If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.
Marty - Microsoft MVP 2009 to 2017
Experts Exchange Most Valuable Expert (MVE) 2015, 2017
Experts Exchange Top Expert Visual Basic Classic 2012 to 2018
Experts Exchange Top Expert VBA 2018