Solved

VB6 send value from grid in Textbox

Posted on 2013-11-12
3
377 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 45

Accepted Solution

by:
Martin Liss earned 500 total points
Comment Utility
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
Comment Utility
HI MartinLiss:

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

Expert Comment

by:Martin Liss
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now