Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2010
    Location
    Manchester
    Posts
    24

    Unanswered: Run-time Error '91'

    Hi, iv put some code into a project im working on, the code is for a flex grid.

    all code seems fine and compiles okay, but i keep getting a runtime error when i click the flexgrid.

    Run-time Error '91'

    Object variable or With block variable not set.


    Heres the code


    Code:
    Private Sub GetBundles(ProductCode)
    Dim Cols As Integer
    Dim Rows As Integer
    Dim cnn As Connection
    Dim Columns
    Dim CurrentColHead As Integer
    Dim InsertCtrlPoints(10)
    Dim Bundles As Recordset
    
    Set cnn = CurrentProject.AccessConnection
    
    
    Cols = 2
    With grdWIPBundles
        .Clear
        .Cols = Cols
        .Row = 2
        .FixedRows = 1
        .FixedCols = 1
        .ColWidth(0) = 155
        .RowHeight(0) = 300
        .FocusRect = flexFocusHeavy
        .SelectionMode = flexSelectionFree
        
        .Row = 0
        
        col_ix = 1
        .TextArray(col_ix) = "Bundle No."
        .ColWidth(col_ix) = 2000
        .ColAlignment(col_ix) = flexAlignLeftCenter
        
        Bundles.Open "SELECT * FROM Vw_Tk_Bundles"   'Debug here
        While Not Bundles.EOF
            .AddItem vbTab & Bundles!BundleNum
            Bundles.MoveNext
        Wend
            Bundles.Close
            .RowHeight(1) = 0
        End With
        cnn.Close
    End Sub

    If anyone has any ideas please let me know!

    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    What's grdWIPBundles ? Where and how is it declared?
    Have a nice day!

  3. #3
    Join Date
    Dec 2010
    Location
    Manchester
    Posts
    24
    Quote Originally Posted by Sinndho View Post
    What's grdWIPBundles ? Where and how is it declared?
    another function declared in the project! and a flex grid on my form, this particular issue i have resolved though - and moved onto the next one!.

    i modded a line of code to Set bundle as a New Recordset

    Code:
    Set Bundles = New Recordset
        Bundles.Open "SELECT * FROM Vw_Tk_Bundles"
        While Not Bundles.EOF

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
  •