Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP8 crash with two related grids

Status
Not open for further replies.

Gameboy9

Programmer
Jun 8, 2001
39
US
The weirdest thing is going on here, but I'm going to try to be as detailed as possible. I'll list the exact error below a starred (*****) line.

I have two tables in this database that are linked to two grids. I'll call them TblA and TblB for security reasons.

TblA has, in order: C(9) UNIQUE (this is generated through SUBSTR(SYS(2015), 2), C(26), C(10), C(4), C(16), D, D, N(10, 2), N(9, 2), C(40), C(70), L, L, T, L, N(6,0), T, C(10), and C(9)

TblB has, in order: C(9) UNIQUE (same generation rules as TblA), C(9) (related to TblA's first field I mentioned), N(10, 2), C(6), C(20), C(8), C(5), C(10), C(5), C(3), L

I'm pulling data into two cursors, call it CUR1 from Tbl1, and CUR2 from Tbl2, - then relate them as follows:

SELECT CUR2
INDEX ON C(9) (2nd field) TAG tag1
INDEX ON C(9) (1st field) TAG tag2
SET ORDER TO uniquetran
SELECT CUR1
SET RELATION TO uniquekey INTO CUR2

-----------------------

now these cursors carry over into another form which has two grids related to each other. The upper grid holds information from CUR1 (the parent table), and the lower grid holds information from CUR2 (the child table). When I move the cursor around in the upper grid(LinkMaster - CUR1, RecordSource - CUR1, Type = Alias), the lower grid updates automatically. (ChildOrder = C(9) (2nd field in Tbl2), LinkMaster = CUR1, RecordSource = CUR2, Type = Alias)

************************

Here's the problem. First, when I move from one record to another, every once in a while, in a completly random pattern, the vertical scrollbar becomes active. (Even if there's only one CUR2 record for that particular line in CUR1.) Secondly, after I do some programmatic updates to the cursors and the tables those cursors got the information from, the program crashes when I go to same said record.

Am I building the relationship incorrectly or is there something else going on? Thanks for your help in advance. :)
 
Hi


SELECT CUR2
INDEX ON C(9) (2nd field) TAG tag1
INDEX ON C(9) (1st field) TAG tag2
SET ORDER TO uniquetran
SELECT CUR1
SET RELATION TO uniquekey INTO CUR2


I am not in agreement with your code here.
SELECT cur2
..
..
SET ORDER TO tag1
** This is your tag unique key as used in CUR1
SELECT cur1
SET RELATION TO uniquekey INTO CUR2

:)

ramani :)
(Subramanian.G)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top