?
Solved

Inserting data into a Flex Grid

Posted on 2003-03-24
2
Medium Priority
?
495 Views
Last Modified: 2012-06-21
Hi i am using an ADO recordset to get my data from the database, but now i would like to list all the data ina flex grid

Im not sure on what sort of loop to use to ensure it all gets in there

string = "" & vbTab & field1 & vbTab & field2 & vbTab & field3 & vbTab & field4
flex_grid.AddItem string

How should i go about looping the above code

Thanks in advance for your help
0
Comment
Question by:Matthew Tandy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
rinksno1 earned 1000 total points
ID: 8199853
'HERE IS THE CODE FIRSTLY THE CHECK IS BEING MADE TO FIND 'OUT WHETHER THE RECRDSET IS EMPTY IF IT IS NOT EMPTY THEN
'REMOVE THE EXISTING ROWS AND THEN INSERT THE ROWS FROM THE 'db ONE BY ONE
'===================================================
    Dim intRowCount As integer

    If rs.EOF And rs.BOF Then Exit Sub
    intRowCount = 1
    MSFgrid.FixedRows = 0

    'REMOVES THE EXISTING ROWS
    For intRowCount = 1 To MSFgrid.Rows - 1
        MSFgrid.RemoveItem 1
    Next intRowCount
       
    While Not rs.EOF
        string = "" & vbTab & field1 & vbTab & field2 & vbTab & field3 & vbTab & field4

       flex_grid.AddItem string
       rs.MoveNext

    Wend

    If MSFgrid.Rows > 1 Then MSFgrid.FixedRows = 1
'====================================================
'RINKS
0
 
LVL 11

Expert Comment

by:supunr
ID: 8199872
why not use a MSHFlexGrid control ("Microsoft Hierachical FlexGrid Control"  and set the datasource.

ie.
Set MSHFlexGrid1.DataSource = rsRecordSet

might even work for FlexGrid itself.  try it...
Set MSFlexGrid1.DataSource = rsRecordSet

then you hide the columns you don't want.
ie.
MSFlexGrid1.ColWidth(2) = 0 ' etc.

Good Luck!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question