Selecting data from MSHFlexGrid vb6

Posted on 2007-10-12
Medium Priority
Last Modified: 2008-01-09
Hello all,

This issue is driving me nuts as it should be simple:
I want to select a cell of retrieved data and have it displayed in a textbox.
I have a form with a MSHFlexGrid that uses Adodc to pull data from a SQL table (select title form titles).
The results of the query show up in the MSHFlexGrid as they should and the data will display in the textbox. However, no matter which cell I choose only the 1st (top) row will display in the textbox. I am using the following:

Private Sub MSHFlexGrid1_Click()
txtTitles.Text = Adodc1.Recordset.Fields("title")
End Sub  

Thanks in advance for your help.

Question by:webquests
1 Comment
LVL 18

Accepted Solution

Sethi earned 1000 total points
ID: 20070089
txtTitles.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row,0)

This will display the text in 1st Column and the selected row. Change the column number in the last argument if you want text from some other column.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Suggested Courses

850 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