Results 1 to 3 of 3

Thread: DBGrid

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    34

    Post

    I build a SELECT query. Now I want to populate my dbgrid based on the query results. How do I do this?

  2. #2

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    34

    Post

    Thanks. My goal was to figure it out w/o usinig data control. So I used MSFlexGrid and populated the grid w/o using the data control. Works great.

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Add a DB grid and data control to your form. Set the DATASOURCE property of the grid to the data control. Add this code where you want it:

    Code:
        Dim db As Database
        
        Set db = DBEngine.OpenDatabase("Nwind.mdb")
        
        Set Data1.Recordset = db.OpenRecordset("Select * from Customers")
        
        db.close
        set db = nothing
    All done

    Tom

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