Flexgrid Field Selection

Hello all!  My problem is this:

I want the user to be able to select several cells in a flexgrid and have those selections populate either a text box or a list box which ever you might recommend.

The reason for the selection is that those cells contain the primary keys to records in my database in which  several common calculations will be performed on.  So, the reason for the choice of text box vs. the list is b/c the entries in that control are going to be the parameter values in the next query.

So, let me again state my question..  How do I allow a user to select multiple values in a flexgrid and then populate another control w/ those values..

I know this is a relatively easy question for the caliber of programmers who frequent this site, however my head is spinning from the quest...Please Help..

Thank you..
John
johnmhatAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MarineCommented:
Its easy to select a range of rows in a flexgrid and then assign it to the textbox. But if you do this the values of the other row will replace the existing values in these textboxes wouldn't it ?
0
adityauCommented:
You can get to knowe about the selected values in the rows and columns using the following.

Private Sub Command1_Click()
    MSFlexGrid1.AllowBigSelection = True
    For inttemp = 1 To MSFlexGrid1.RowSel
        For inttemp1 = 1 To MSFlexGrid1.ColSel
            MsgBox MSFlexGrid1.TextMatrix(inttemp, inttemp1)
        Next
    Next
End Sub

You better use a list view or another grid to display the selected values as the values in the text box will be over written when you select another cell.
0
johnmhatAuthor Commented:
Yes, they could, but in this case that would be ok...

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

adityauCommented:
Then use Text box.
0
johnmhatAuthor Commented:
Adityau,  First, thanks for the help.
I tried the code, however it still selects only one record, I don't know what I am doing wrong or what I am not doing....
Here is the code I am using....

Private Sub cmdSelect_Click()
flexExpNumbers.AllowBigSelection = True
    For inttemp = 1 To flexExpNumbers.RowSel
        For inttemp1 = 1 To flexExpNumbers.ColSel
           Text25.Text = flexExpNumbers.TextMatrix(inttemp, inttemp1)
            Next
        Next

End Sub

Thanks,
0
adityauCommented:
Do you want all the values selected in the cells in the text box? If so, please set the Multiline property to True and then concatenate TextMatrix with vbCrlf.

Is it the one which is not working?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
johnmhatAuthor Commented:
Thanks, sorry for the delay
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.