Results 1 to 3 of 3

Thread: Populate MSHFLEXGRID with 3 or 4 levels

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Arrow Populate MSHFLEXGRID with 3 or 4 levels

    Hi
    I have a recordset (using oo40) , my records are from a hierachical querie , I would like put in MSHflexgrid with buttom plus (+) that expand others row.

    I searched in google, but no find example

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,624

    Re: Populate MSHFLEXGRID with 3 or 4 levels

    Might be the language barrier, Eu nao sei, mas...I do not understand what you want. I THINK what you want is to show only a certain number of rows in an MSHFlexGrid, and instead of a scrollbar, you want to put some sort of control on your form to expand more rows below the already 'fixed' rows...is that just about it?

  3. #3
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    3,130

    Re: Populate MSHFLEXGRID with 3 or 4 levels

    I think he wants to use MSDataShape

    here a Linkhttp://www.vbforums.com/showthread.p...-shape-command

    EDIT: here a sample with the Northwind Database

    Code:
    Option Explicit
    Private Cn As New ADODB.Connection
    Private Rs As New ADODB.Recordset
    
    Private Sub Command1_Click()
        Set Rs = New ADODB.Recordset
        Rs.Open "SHAPE {SELECT CustomerID, CompanyName FROM Customers} APPEND ((SHAPE {SELECT * FROM Orders} APPEND ({SELECT * FROM [Order Details]} AS rstOrderDetails RELATE OrderID TO OrderID)) RELATE CustomerID TO CustomerID)", Cn, adOpenForwardOnly, adLockReadOnly
        Rs.Requery
        Set MSHFlexGrid1.DataSource = Rs
    
    End Sub
    
    Private Sub Form_Load()
    Dim strDatabase As String
      Set Cn = New Connection
      Cn.CursorLocation = adUseClient
      strDatabase = "E:\Northwind.mdb"
      Cn.Open "PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDatabase & ";Jet OLEDB:Database Password='';"
    
    End Sub
    IMO 3-4 Levels just look bad
    Last edited by ChrisE; Jan 11th, 2019 at 12:12 PM.
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

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