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
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
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.AllowBigSelect ion = True
For inttemp = 1 To MSFlexGrid1.RowSel
For inttemp1 = 1 To MSFlexGrid1.ColSel
MsgBox MSFlexGrid1.TextMatrix(int temp, 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.
Private Sub Command1_Click()
MSFlexGrid1.AllowBigSelect
For inttemp = 1 To MSFlexGrid1.RowSel
For inttemp1 = 1 To MSFlexGrid1.ColSel
MsgBox MSFlexGrid1.TextMatrix(int
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.
ASKER
Yes, they could, but in this case that would be ok...
Then use Text box.
ASKER
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.AllowBigSel ection = True
For inttemp = 1 To flexExpNumbers.RowSel
For inttemp1 = 1 To flexExpNumbers.ColSel
Text25.Text = flexExpNumbers.TextMatrix( inttemp, inttemp1)
Next
Next
End Sub
Thanks,
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.AllowBigSel
For inttemp = 1 To flexExpNumbers.RowSel
For inttemp1 = 1 To flexExpNumbers.ColSel
Text25.Text = flexExpNumbers.TextMatrix(
Next
Next
End Sub
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, sorry for the delay