| | |
Text collect from MSflexgrid to textbox
Thread Solved |
I have 4 text box in a form. when I click a button another Form show with a MSflexgrid. when I click in a msflexgrid the data show a text box of another form. I write code:
form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
But I when I click msflexgrid the same data show all 4 textbox. But I want 4 item of data in msflexgrid show in 4 text box separetly . please help me.
form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel)
But I when I click msflexgrid the same data show all 4 textbox. But I want 4 item of data in msflexgrid show in 4 text box separetly . please help me.
If the remaining cells are the adjacent to each other, you can hardcode the column numbers!
The row is constant for the row u have selected. only change the columns.
Regards
Shaik Akthar
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 0) 'For data in Column 0 form1.Text2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 1) 'For data in Column 1 form1.Text3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 2) 'For data in Column 2 form1.Text4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 3) 'For data in Column 3
The row is constant for the row u have selected. only change the columns.
Regards
Shaik Akthar
Last edited by aktharshaik; Oct 28th, 2008 at 5:52 am.
Use Select Case
Regards
Shaik Akthar
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Select Case MSFlexGrid1.ColSel Case 0: form1.Text1.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel) goto Label1 Case 1: form1.Text2.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel) goto Label1 Case 2: form1.Text3.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel) goto Label1 Case 3: form1.Text4.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, MSFlexGrid1.ColSel) goto Label1 End Select Label1:
Regards
Shaik Akthar
Last edited by aktharshaik; Oct 28th, 2008 at 6:14 am.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Visual Basic 6.0
- Next Thread: Comparing list boxes and alert the users
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





