• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

creat grids with cursors

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?
1 Solution
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.
luciliacoelhoAuthor Commented:
this solution didn´t solve the problem, the tables has a larger struture and the set filt is´t efficient.
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.
Olaf DoschkeSoftware DeveloperCommented:
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.
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now