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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataEnvironment Relationship Not Updating

Status
Not open for further replies.

SleepDepD

Programmer
Mar 13, 2004
65
US
Here's what I've got; I appreciate any help:

In the DataEnvironment of my form I have 2 tables, "tblRoute" and "tblPeople". Both tables have a field "PeopleID", and conceptually there is a one-to-many relationship from "tblRoute" to "tblPeople" using them--but we're not using persistant relationships in our database. In the DataEnvironment however I have a relationship drawn between the two tables--with "ChildAlias='tblPeople'".

On my form, the user can select the "PeopleID" to go into "tblRoute"--this is no problem:
Code:
REPLACE PeopleID WITH lnNewPeople IN "tblRoute"
However, the textbox on the form where the person is displayed doesn't update. The new value is going into "tblRoute", but "tblPeople" isn't moving to the corresponding record. I'm under the impression that since I setup that relationship in the DataEnvironment, "tblPeople" should keep in sync with whatever's in it's joining field. Am I wrong on this?

I'm currently using this solution:
Code:
** "lnNewPeople" already has the new PeopleID
SELECT "tblPeople"
LOCATE FOR personid=lnNewPeople
IF !FOUND("tblPeople")
	** Display appropriate MessageBox here
	lnNewPeople=0
ENDIF
SELECT "tblRoute"
REPLACE PeopleID WITH lnNewPeople IN "tblRoute"
** Call Refresh method

This works, but I'm wondering if I'm missing a step, or just misunderstanding VFP. Thanks again.
 
I don't think the relationship updates until the record pointer is moved.

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top