Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding text boxes to MSHFlexGrid

Status
Not open for further replies.

Sam8932

Programmer
Oct 15, 2002
22
0
0
Hello,
I was using a datagrid and had my text boxes bound to it. I switched to a flexgrid to allow the user to delete multiple selections. How can I(if I can) bind my text boxes to the flexgrid? Here is the code I was using for the datagrid.

'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next

Thank you in advance,

Sam
 
I should maybe explain better what I'm trying to do here. I have 5 text boxes and a flexgrid on my form. When the user selects a row on the flexgrid, I want the values in that row to show up in my text boxes. I hope this is enough info.

Thanks,

Sam
 
I could really use some help with this one. I would appreciate any advice I can get. Thank you.

Sam
 
Take a look at this, it might help :

thread222-370368
 
The simplest thing would be to make the assignments in the Click event of the grid. Something like the following:

Private Sub grdGrid_Click()

Dim iRow as Integer

iRow = grdGrid.Row
txtB1.Text = grdGrid.TextMatrix(iRow, 0)
txtB2.Text = grdGrid.TextMatrix(iRow, 1)
...

End Sub Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Thank you CajunCenturion. That worked great. Now I need to be able to allow the user to change the values in the text box and have those values change in the flexgrid(which I've been able to do) and have the new values be saved to the database(this is what I can't figure out). The values change in the flexgrid, but when I close the form and go back into it, the old values are there. The new values aren't being saved to the database. Can you or anyone else help me out with this. I've been trying to figure it out on my own for the past couple of working days and I haven't gotten anywhere. Any help would be greatly appreciated. Thank you in advance.

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top