Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Assigning value to a label or textbox for row.,col selected from msflexgrid

Posted on 2004-11-04
4
Medium Priority
?
206 Views
Last Modified: 2013-12-25
HOw would I display the value of row, col seected in a label?
0
Comment
Question by:zachvaldez
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 12498214
x = MSFlexGrid1.RowSel
Mydata = MSFlexGrid1.Textmatrix(x,2)

text1.text = MyData
or
label1.caption = mydata
0
 

Expert Comment

by:hayousuf
ID: 12498676

  all you have to do is assign the textbox's text property or labels caption property to that of the MSFlegrids Rowsel proerty.
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12502096
Private Sub MSFlexGrid1_SelChange()
    Label1.Caption = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, MSFlexGrid1.Col)
End Sub
0
 
LVL 11

Accepted Solution

by:
dbrckovi earned 200 total points
ID: 12502154
Or this if you want currently selected Row/Col values

Private Sub MSFlexGrid1_SelChange()
    Label1.Caption = "Row:" & MSFlexGrid1.Row & _
                  "   Col:" & MSFlexGrid1.Col & _
                  "   Val:" & MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, MSFlexGrid1.Col)
End Sub



BTW.
.Row and .Col are more "precise" than .RowSel and ColSel

If you select multiple cells, then Row/Col will point to cell where you began selecting (where you pressed mouse button), and RowSel/ColSel will point to cell where you released mouse button.
The cell where you began is actualy your current cell, not the last.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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
Course of the Month20 days, 17 hours left to enroll

810 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