creat grids with cursors

Posted on 2011-04-25
Last Modified: 2012-05-11
I have a set of grids that depend between each other, and i must create a cursor to second grid with the user selection on ther first grid. The problem is that the grid headers disappear and in their places appear the cursor fields.
How can i solv this problem?
Question by:luciliacoelho
    LVL 27

    Expert Comment

    You can use the same table or cursor but under a different alias and it can be filtered.

    USE table1 AGAIN IN 0 ALIAS table2.
    SELECT table2
    SET FILTER TO selected

    Like this the two grids work independently from each other and the grid columns won't disappear.

    Or you can create another table/cursor and append the records from the first

    SELECT table2
    APPEND FROM table1 WHERE selected.

    Author Comment

    this solution didn´t solve the problem, the tables has a larger struture and the set filt is´t efficient.
    LVL 27

    Accepted Solution

    You have to redefine the structure for the grid. I just gave you two ideas. One to use a different alias with filter and the other to use a cursor with the selected records only.
    LVL 29

    Expert Comment

    by:Olaf Doschke
    The visual problem you have with grid headers is called grid reconstruction.

    Before you create the cursor for the secondary grid (again), set it's recordsource = "" and after you created the cursor set it back to the alias name.

    If you don't do that the grid loses columns detail information and rebuilds. And when rebuilding, the headers caption are the field names of the cursor.

    Bye, Olaf.
    LVL 1

    Expert Comment

    select * from table1 where 1=2 into cursor table2_dummy
    thisform.grid2.recordsource = "table2_dummy"
    select * from table1 where "insert real condition here" into cursor table2
    thisform.grid2.recordsource = "table2"

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Visual Fox Pro commands 15 17
    Database Upscaling 9 82
    export vfp file to csv WITHOUT field names 2 387
    break table into files vfp 2 78
    Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: (http://msd…
    DECT technology has become a popular standard for wireless voice communication. DECT devices are not likely to be affected by other electronic devices and signals because they operate in a separate frequency-band.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now