Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB6 send value from grid in Textbox

Posted on 2013-11-12
3
Medium Priority
?
394 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
[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
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 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 49

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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