CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2013
    Location
    Chicago
    Posts
    3

    Question FlexGrid Issue, visual basic 6, VB6

    Hello everyone,
    I am having an issue with the Flexgrid, when I have data shows up on the flexgrid, it seems like it is skipping the rows where the first column is missing data, it would not write to the rest of cells in that row. I am attaching the code as well as the screen print of the flexgrid. The flexgrid is meant to pull stock information for sql, this is for a financial industry. As you could see from the screenprint, the the third row has data in the other columns even if there are no shares or weight. Can you see if there is somewhere in the code that specifies that skip the row if there are no data in the first column, please help, thanks. P.S. Please check the attached image file also, thanks.
    Attached Images Attached Images  
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: FlexGrid Issue, visual basic 6, VB6

    Your code is very difficult to read, not formatted properly and lots of stuff that has been commented out makes it hard to follow.

    You have several different Select case blocks that are basically the same and from the looks of it each has only one case in it. Each of these are also with in an if block that is doing the same test a bunch of times. It would appear that 1 If block would be enough to check the recordcount. The purpose of Select Case is to have more than one case otherwise you would just use an if statement.

    For example Instead of doing this
    Code:
     Select Case rsAcctData.Fields("Fund")
            Case "Endeavor"
    End Select
     Select Case rsAcctData.Fields("Fund")
            Case "vismain"
    End Select
    Select Case rsAcctData.Fields("Fund")
            Case "Global"
    End Select
    You should be doing
    Code:
     Select Case rsAcctData.Fields("Fund")
            Case "Endeavor"
    
            Case "vismain"
    
            Case "Global"
    End Select
    As for the source of the issue, I can't tell, maybe if you clean up the code, get rid of all the commented stuff and properly format it then it may be a bit easier to see where the problem is.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Mar 2013
    Location
    Chicago
    Posts
    3

    Re: FlexGrid Issue, visual basic 6, VB6

    Thanks sir, I am going to try to clean up the code and try it and paste that up here, thanks.

  4. #4
    Join Date
    Mar 2013
    Location
    Chicago
    Posts
    3

    Re: FlexGrid Issue, visual basic 6, VB6

    Hello, thanks for your suggestion, but when I do what you sugguested me after cleaning up the code, it would not write to the next row, previously the flex screen use to order the funds by the amount of shares, so it will write from bottom to first, but now I am trying to have the funds static, like I have attached on the screen shot, please help, thanks. Name:  flexgridissue#2.JPG
Views: 1570
Size:  30.5 KBflexgridissue#2.txt

  5. #5
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: FlexGrid Issue, visual basic 6, VB6

    I'm not really sure what you are trying to do there. The code looks better but is still hard to read due to improper formatting. As for the Select Case the purpose of using a select case statement is to do different things based on different values, typically a case block should have at least 2 or more cases. If your first code was doing what you want or close then perhaps you do not need a select case at all a simple if statement would do the trick.

    That said I do not see any looping so maybe that is an issue but I can't be sure because I can't really follow your code and I do not know what you are trying to do.
    Always use [code][/code] tags when posting code.

Tags for this Thread

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

Featured