[RESOLVED] FlexGrid Cell being replaced.
I have a data base file that I populate a MsFlexGrid with.
I have a Label that displays a cell from MsFlexGrid1 using this command.
Code:
Label1.Caption = MsFlexGrid1.TextMatrix(1, 3)
Works fine,
but the cell that was placed in Label1 replaced the cell value at location (1,1) in the MSFlexGrid.
Whats causing this? Is there a way to freeze the MsFlexGrid so it can't be written to?
Re: FlexGrid Cell being replaced.
Quote:
Originally Posted by
Bob K
but the cell that was placed in Label1 replaced the cell value at location (1,1) in the MSFlexGrid.
Whats causing this?
It's caused by your own program - debug it (step through the code) or search for TextMatrix or set Watch so program would stop when certain condition is met...
Re: FlexGrid Cell being replaced.
From the code you have posted I can't see how this would happen.
Are you sure that there is not another line(s) of code that is coping this data to the cell.
eg.
Code:
MsFlexGrid1.textmatrix(1,1) = Label1.caption
double check anything that says = Label1.Caption because it may not be obvious.
Cheers,
Hojo
Re: FlexGrid Cell being replaced.
Quote:
Originally Posted by
RhinoBull
It's caused by your own program - debug it (step through the code) or search for TextMatrix or set Watch so program would stop when certain condition is met...
This is all the code that I have so far.
Code:
Private Sub Label3_Change()
Label3.Caption = Grid.TextMatrix(2, 1)
End Sub
Form consists of:
1 MsFlexGrid
1 Label
1 Data Control to populate the MsFlexGrid with the Access file
That's it.
Re: FlexGrid Cell being replaced.
i already post a random selection code in ur another thread "MsFlexGrid value placed in textbox ?"
there is no problm for me, which line of ur code change flexgrid cell value?
Re: FlexGrid Cell being replaced.
Do you have the label bound to the Datacontrol.
If you do this may be causing your problem.
Also I am unclear why this line of code is in the label3_change() sub.
Basically reads, when label3 changes -> change label3
I think binding your caption is the problem because if it's not bound then I don't see how the sub ever executes.
Cheers,
Hojo