Results 1 to 6 of 6

Thread: [RESOLVED] FlexGrid Cell being replaced.

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2009
    Posts
    46

    Resolved [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?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: FlexGrid Cell being replaced.

    Quote Originally Posted by Bob K View Post
    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...

  3. #3
    Lively Member Hojo's Avatar
    Join Date
    Jul 2005
    Location
    Brisbane, Australia
    Posts
    119

    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!

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2009
    Posts
    46

    Re: FlexGrid Cell being replaced.

    Quote Originally Posted by RhinoBull View Post
    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.

  5. #5
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    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.
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  6. #6
    Lively Member Hojo's Avatar
    Join Date
    Jul 2005
    Location
    Brisbane, Australia
    Posts
    119

    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
  •  



Click Here to Expand Forum to Full Width