MSFlexGrid display - basic.visual

This is a discussion on MSFlexGrid display - basic.visual ; "Peter Lawton" <peter_john.lawton@virgin.net> schreef in bericht news:Ow1Yi.34502$9Y3.17465@newsfe1-win.ntli.net... > Just a thought, if there is a tiny bit of the bottom Row showing then it > is regarded as all showing by MSFlexGrid > Might be an idea to try decreasing ...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

MSFlexGrid display

  1. Default Re: MSFlexGrid display


    "Peter Lawton" <peter_john.lawton@virgin.net> schreef in bericht
    news:Ow1Yi.34502$9Y3.17465@newsfe1-win.ntli.net...
    > Just a thought, if there is a tiny bit of the bottom Row showing then it
    > is regarded as all showing by MSFlexGrid
    > Might be an idea to try decreasing the height of the Grid by 15 twips.
    > Peter


    I had exactly the same and it appeared that when I changed the Height
    of the grid just a little bit it was OK. Think Peter is right.
    Bert.


  2. Default Re: MSFlexGrid display


    Now that I have some time and put your code into the program, I have a problem. It hangs up (see
    below) with Runtime Error 30009 Invalid Row Value on the very first entry. I typed in Alpha 161070,
    it displayed in the grid and the error message popped up. I didn't get to type in a second entry.
    The value of NextRow was 2.
    Your code worked in the test program. What am I doing wrong?


    Option Explicit

    Private Sub CmdArtistSong_Click()

    Dim iCnt As Integer

    Static NextRow As Long
    Const NumOfVisibleRows As Long = 4

    'If file size not entered stop the sub
    If TxtSize.Text = "" Then
    TxtSize.SetFocus
    Exit Sub
    End If

    'set up Row count using iCnt. TxtEntryNbr.Text must have a zero to start
    If TxtEntryNbr.Text = "" Then
    TxtEntryNbr.Text = "0"
    End If
    iCnt = Val(TxtEntryNbr.Text)
    iCnt = iCnt + 1


    With MSFlexGrid1
    If NextRow = 0 Then
    Do
    NextRow = NextRow + 1
    Loop While Len(.TextMatrix(NextRow, .FixedCols))
    NextRow = NextRow + (.FixedRows = 0)
    End If
    .TextMatrix(NextRow, 1) = iCnt
    .TextMatrix(NextRow, 2) = TxtSize.Text
    .TextMatrix(NextRow, 3) = TxtArtistSong.Text
    NextRow = NextRow + 1
    If Not .RowIsVisible(NextRow) Then '#### Invalid Row Value
    .TopRow = NextRow - NumOfVisibleRows
    End If
    End With

    With TxtArtistSong
    .SetFocus
    .SelStart = 0
    .SelLength = Len(.Text)
    End With


    TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtSize.Text)
    TxtEntryNbr.Text = iCnt
    TxtArtistSong.Text = ""
    TxtSize.Text = ""

    qNbrEntries = iCnt
    gTotal = TxtTotal.Text

    End Sub



  3. Default Re: MSFlexGrid display

    How many rows do you have the grid set for. Also, can you give me a hint of
    your form's layout and what is being filled in and where does it go (I think
    I have an idea, but it would be more helpful if you outlined it for me)? In
    particular, what is iCnt doing for?

    Rick


    > Now that I have some time and put your code into the program, I have a
    > problem. It hangs up (see below) with Runtime Error 30009 Invalid Row
    > Value on the very first entry. I typed in Alpha 161070, it displayed in
    > the grid and the error message popped up. I didn't get to type in a
    > second entry. The value of NextRow was 2.
    > Your code worked in the test program. What am I doing wrong?
    >
    >
    > Option Explicit
    >
    > Private Sub CmdArtistSong_Click()
    >
    > Dim iCnt As Integer
    >
    > Static NextRow As Long
    > Const NumOfVisibleRows As Long = 4
    >
    > 'If file size not entered stop the sub
    > If TxtSize.Text = "" Then
    > TxtSize.SetFocus
    > Exit Sub
    > End If
    >
    > 'set up Row count using iCnt. TxtEntryNbr.Text must have a zero to
    > start
    > If TxtEntryNbr.Text = "" Then
    > TxtEntryNbr.Text = "0"
    > End If
    > iCnt = Val(TxtEntryNbr.Text)
    > iCnt = iCnt + 1
    >
    >
    > With MSFlexGrid1
    > If NextRow = 0 Then
    > Do
    > NextRow = NextRow + 1
    > Loop While Len(.TextMatrix(NextRow, .FixedCols))
    > NextRow = NextRow + (.FixedRows = 0)
    > End If
    > .TextMatrix(NextRow, 1) = iCnt
    > .TextMatrix(NextRow, 2) = TxtSize.Text
    > .TextMatrix(NextRow, 3) = TxtArtistSong.Text
    > NextRow = NextRow + 1
    > If Not .RowIsVisible(NextRow) Then '#### Invalid Row
    > Value
    > .TopRow = NextRow - NumOfVisibleRows
    > End If
    > End With
    >
    > With TxtArtistSong
    > .SetFocus
    > .SelStart = 0
    > .SelLength = Len(.Text)
    > End With
    >
    >
    > TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtSize.Text)
    > TxtEntryNbr.Text = iCnt
    > TxtArtistSong.Text = ""
    > TxtSize.Text = ""
    >
    > qNbrEntries = iCnt
    > gTotal = TxtTotal.Text
    >
    > End Sub
    >



  4. Default Re: MSFlexGrid display

    iCnt counts the number of entries, nothing more. qNbrEntries = iCnt
    For some reason I hit the "q" instead of the "g" when I made that Public
    The grid shows just 4 rows and 3 columns.
    The "Alpha" is entered in TxtArtistSong.Text
    Hit Tab
    The 161070 is entered in TxtSize.Text
    Hit CmdArtistSong to enter
    MSFlexGrid1 displays
    1 161070 Alpha
    The total number of entries (iCnt) are displayed and the total KBs are displayed. Near bottom of
    sub.
    The input information, displayed in the FlexGrid, is then sorted and printed.

    Is that enough or do you need more details?

    Jim Y

    "Rick Rothstein (MVP - VB)" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
    news:fPednTK2duOxUananZ2dnUVZ_v-hnZ2d@comcast.com...
    > How many rows do you have the grid set for. Also, can you give me a hint of your form's layout and
    > what is being filled in and where does it go (I think I have an idea, but it would be more helpful
    > if you outlined it for me)? In particular, what is iCnt doing for?
    >
    > Rick
    >
    >
    >> Now that I have some time and put your code into the program, I have a problem. It hangs up (see
    >> below) with Runtime Error 30009 Invalid Row Value on the very first entry. I typed in Alpha
    >> 161070, it displayed in the grid and the error message popped up. I didn't get to type in a
    >> second entry. The value of NextRow was 2.
    >> Your code worked in the test program. What am I doing wrong?
    >>
    >>
    >> Option Explicit
    >>
    >> Private Sub CmdArtistSong_Click()
    >>
    >> Dim iCnt As Integer
    >>
    >> Static NextRow As Long
    >> Const NumOfVisibleRows As Long = 4
    >>
    >> 'If file size not entered stop the sub
    >> If TxtSize.Text = "" Then
    >> TxtSize.SetFocus
    >> Exit Sub
    >> End If
    >>
    >> 'set up Row count using iCnt. TxtEntryNbr.Text must have a zero to start
    >> If TxtEntryNbr.Text = "" Then
    >> TxtEntryNbr.Text = "0"
    >> End If
    >> iCnt = Val(TxtEntryNbr.Text)
    >> iCnt = iCnt + 1
    >>
    >>
    >> With MSFlexGrid1
    >> If NextRow = 0 Then
    >> Do
    >> NextRow = NextRow + 1
    >> Loop While Len(.TextMatrix(NextRow, .FixedCols))
    >> NextRow = NextRow + (.FixedRows = 0)
    >> End If
    >> .TextMatrix(NextRow, 1) = iCnt
    >> .TextMatrix(NextRow, 2) = TxtSize.Text
    >> .TextMatrix(NextRow, 3) = TxtArtistSong.Text
    >> NextRow = NextRow + 1
    >> If Not .RowIsVisible(NextRow) Then '#### Invalid Row Value
    >> .TopRow = NextRow - NumOfVisibleRows
    >> End If
    >> End With
    >>
    >> With TxtArtistSong
    >> .SetFocus
    >> .SelStart = 0
    >> .SelLength = Len(.Text)
    >> End With
    >>
    >>
    >> TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtSize.Text)
    >> TxtEntryNbr.Text = iCnt
    >> TxtArtistSong.Text = ""
    >> TxtSize.Text = ""
    >>
    >> qNbrEntries = iCnt
    >> gTotal = TxtTotal.Text
    >>
    >> End Sub
    >>

    >




  5. Default Re: MSFlexGrid display

    I made a few changes in the sub and it appears to be working. Note the inclusion of .Rows.
    Thank you for your help Rick.
    Jim

    With MSFlexGrid1
    If NextRow = 0 Then
    Do
    NextRow = NextRow + 1
    Loop While Len(.TextMatrix(NextRow, .FixedCols))
    NextRow = NextRow + (.FixedRows = 0)
    Else
    .Rows = iCnt + 1
    NextRow = NextRow + 1
    End If

    .TextMatrix(NextRow, 1) = iCnt
    .TextMatrix(NextRow, 2) = TxtSize.Text
    .TextMatrix(NextRow, 3) = TxtArtistSong.Text

    If NumOfVisibleRows < NextRow Then
    .TopRow = .Rows - NumOfVisibleRows
    End If
    End With

    "Rick Rothstein (MVP - VB)" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
    news:fPednTK2duOxUananZ2dnUVZ_v-hnZ2d@comcast.com...
    > How many rows do you have the grid set for. Also, can you give me a hint of your form's layout and
    > what is being filled in and where does it go (I think I have an idea, but it would be more helpful
    > if you outlined it for me)? In particular, what is iCnt doing for?
    >
    > Rick
    >
    >
    >> Now that I have some time and put your code into the program, I have a problem. It hangs up (see
    >> below) with Runtime Error 30009 Invalid Row Value on the very first entry. I typed in Alpha
    >> 161070, it displayed in the grid and the error message popped up. I didn't get to type in a
    >> second entry. The value of NextRow was 2.
    >> Your code worked in the test program. What am I doing wrong?
    >>
    >>
    >> Option Explicit
    >>
    >> Private Sub CmdArtistSong_Click()
    >>
    >> Dim iCnt As Integer
    >>
    >> Static NextRow As Long
    >> Const NumOfVisibleRows As Long = 4
    >>
    >> 'If file size not entered stop the sub
    >> If TxtSize.Text = "" Then
    >> TxtSize.SetFocus
    >> Exit Sub
    >> End If
    >>
    >> 'set up Row count using iCnt. TxtEntryNbr.Text must have a zero to start
    >> If TxtEntryNbr.Text = "" Then
    >> TxtEntryNbr.Text = "0"
    >> End If
    >> iCnt = Val(TxtEntryNbr.Text)
    >> iCnt = iCnt + 1
    >>
    >>
    >> With MSFlexGrid1
    >> If NextRow = 0 Then
    >> Do
    >> NextRow = NextRow + 1
    >> Loop While Len(.TextMatrix(NextRow, .FixedCols))
    >> NextRow = NextRow + (.FixedRows = 0)
    >> End If
    >> .TextMatrix(NextRow, 1) = iCnt
    >> .TextMatrix(NextRow, 2) = TxtSize.Text
    >> .TextMatrix(NextRow, 3) = TxtArtistSong.Text
    >> NextRow = NextRow + 1
    >> If Not .RowIsVisible(NextRow) Then '#### Invalid Row Value
    >> .TopRow = NextRow - NumOfVisibleRows
    >> End If
    >> End With
    >>
    >> With TxtArtistSong
    >> .SetFocus
    >> .SelStart = 0
    >> .SelLength = Len(.Text)
    >> End With
    >>
    >>
    >> TxtTotal.Text = Val(TxtTotal.Text) + Val(TxtSize.Text)
    >> TxtEntryNbr.Text = iCnt
    >> TxtArtistSong.Text = ""
    >> TxtSize.Text = ""
    >>
    >> qNbrEntries = iCnt
    >> gTotal = TxtTotal.Text
    >>
    >> End Sub
    >>

    >




+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. MSFlexGrid-Ola
    By Application Development in forum basic.visual
    Replies: 8
    Last Post: 01-09-2007, 11:57 AM
  2. MSFlexGrid usage
    By Application Development in forum basic.visual
    Replies: 1
    Last Post: 10-25-2006, 03:06 AM
  3. MSFlexGrid
    By Application Development in forum ADO DAO RDO RDS
    Replies: 10
    Last Post: 06-10-2005, 05:36 PM
  4. MSFlexGrid
    By Application Development in forum basic.visual
    Replies: 3
    Last Post: 03-15-2005, 10:00 PM
  5. MSFlexGrid
    By Application Development in forum basic.visual
    Replies: 1
    Last Post: 06-29-2004, 12:06 PM