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:
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:
This works, but I'm wondering if I'm missing a step, or just misunderstanding VFP. Thanks again.
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"
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.