Solved

VB6 send value from grid in Textbox

Posted on 2013-11-12
3
385 Views
Last Modified: 2013-11-13
Hello all

I would like to know how i can send the value from a grid cell to a couple of textbox.

Ex:

If i click in a cell from column 0 of my MSFexgrid1, it will paste the cell value into my TEXT1.

If i click in a cell from column 1, it will send the value to TEXT2

How can i do that?

Thanks again for your help.

Clipboard.clear
Clipboard.SetText MSHFlexGrid1.Clip

Text1.Text = MSHFlexGrid1
Text1.Font.Bold = True

Open in new window

0
Comment
Question by:Wilder1626
  • 2
3 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39643690
Private Sub MSHFlexGrid1_Click()

If MSHFlexGrid1.Col = 0 Then
    Text1.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, MSHFlexGrid1.Col)
Else
    If MSHFlexGrid1.Col = 1 Then
        Text2.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, MSHFlexGrid1.Col)
    End If
End If


End Sub

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 39644175
HI MartinLiss:

Thanks again for your help. this work great.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39644848
Once again you're welcome and I'm glad I was able to help.

Select the 'About Me' tab in my profile and you'll find links to some articles I've written (including a new one that shows how to float an ActiveX control on a sheet) that may interest you.
Marty - MVP 2009 to 2013
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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 have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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