In my test setup, I have one table that is related to a second table in
a 1-> many relationship and the second table is related to the third in
a 1->many relationship. The first table has one record, the second
table has one record related to it and the third table has several
records related to this record.
When I run my test program, the grid shows the two rows. Some of the
time, there are ** that correctly indicate the skipped records. Other
times, there are **, but they do not reflect the data relationships.
When I tried setting up the relationships using the data environment, I
was never able to see more than one row in the grid (i.e., it showed the
one record for each of the first two tables, but only the first record
for the third table).
Am I correct to assume that the properties in the grid are used to
indicate a relationship where the records displayed in the grid are
children of a table that is not part of the grid? In my situation, the
lead table in the grid is the one that drives the other n tables that
are part of the grid.
I have spent some time checking out views and I don't think they will
work for my situation.
1 - I need to be able to build the relationships at run time. The user
configures which tables to display and where to display them.
2 - I need to be able to set skip to show how the various records are
related.
I have spent the last few days trying different alternatives.
Here is the test prg that I have been using.
I am beating my head against a wall and would really appreciate any more
ideas. I would love to send the test setup to anyone that would be
willing to try it.
I am afraid that describing this situation is difficult on 'paper'. If
anyone would be willing to discuss this with me, I would be happy to
either call you at your convenience or have you call me. My number is
(313) 761-4940 x 206.
TIA
Regards,
Karen Lahey
(313) 761-4940 x 206
*--------------------------------------------------------------------
* This program illustrates a problem in the VFP 5.0 Grid control.
* The control seems to get its 1-many relationships confused some
* of the time.
* If you run this program, it will fail on the 2nd, 5th, 8th, ...
* repetition. If you remove the indicated instruction, it fails
* every 5th time instead of every 3rd time.
* The correct behavior is for the grid to show two rows of three
* cells:
* 10 01 Surface...
*** *** Rust
* When the program fails, the grid displays:
* 10 01 Surface...
*** 01 ***
* In the real program, from which this example was extracted with
* much anguish, the results seem much more random. Failures always
* consist of either asterisks in a cell that should show data, and/or
* data repeated in a cell that should show asterisks.
CLOSE DATA ALL
SET EXACT OFF
OPEN DATABASE AQuAdata
SET DATABASE TO AQuAdata
use dd_table
select 0 && if this instruction removed, cycle goes from 3 to 5.
use aqid
select 0
use pfmodein
set order to tag pfmodei1
select 0
use oppcrel
set order to tag oppcrel1
set relation to partid+opid+prfuncid+oppcrelid into pfmodein additive
select 0
use prfunc
set order to tag prfun1
set relation to partid+opid+prfuncid into oppcrel additive
set skip to oppcrel,pfmodein
do form gridbug name oform linked
wait window "done"
release oform
RETURN
*--------------------------------------------------------------------