|
-
Oct 6th, 2009, 06:15 PM
#1
Thread Starter
Member
[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?
-
Oct 6th, 2009, 08:55 PM
#2
Re: FlexGrid Cell being replaced.
 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...
-
Oct 6th, 2009, 08:57 PM
#3
Lively Member
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
Despite body and mind, my youth will never die!
Everytime I learn something new it pushes some old stuff out of my brain!
-
Oct 6th, 2009, 10:25 PM
#4
Thread Starter
Member
Re: FlexGrid Cell being replaced.
 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.
-
Oct 6th, 2009, 10:31 PM
#5
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?
Last edited by seenu_1st; Oct 6th, 2009 at 11:12 PM.
-
Oct 6th, 2009, 10:56 PM
#6
Lively Member
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
Despite body and mind, my youth will never die!
Everytime I learn something new it pushes some old stuff out of my brain!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|