Link to home
Start Free TrialLog in
Avatar of johnmhat
johnmhat

asked on

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
Avatar of Marine
Marine

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 ?
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.
Avatar of johnmhat

ASKER

Yes, they could, but in this case that would be ok...

Then use Text box.
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,
ASKER CERTIFIED SOLUTION
Avatar of adityau
adityau

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, sorry for the delay