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

Skipping Not Working as Expected

Status
Not open for further replies.

stanlyn

Programmer
Sep 3, 2003
945
US
Hi,

Skip is not working as expected.

On a simple form with a grid representing the children (many side of a 1 to many) relationship and regular textboxes on the form representing the parent table. A next and prev button also. Also a data env with a 1 t many relation set.

The next command button has in its click event
skip 1 in "parent"

Now,if the parent has 10 child records, the skip 1 does not skip 1 in the parent, instead it skips down the children until no more children exists, then it skips to the next parent.

The command is very specific what skip should act upon, the parent (via the optional clause).

why, and how do I force it to skip 1 in the parent every time the next button is pressed?

Thanks, Stanley



 
The skip is as you intended it to be. If you don't want that, then don't do it.
If you don't want the parent skip to skip through child records, set up a on-to-one relationship, even though there are N child records. Then you'll skip to the first child.

Or don't use relations but use SET KEY in the child alias.

Bye, Olaf.
 
It sounds like you've SET SKIP TO <child alias>.

Don't.

The behavior you seek is the default behavior in the Xbase programming language. Using SET SKIP is altering that default behavior.
 
Hi Dan,

I did not intentionally use "set skip to" anywhere in code. I did however change the relation from "1 to 1" to "1 to n". But changing that could have implied the "set skip to". Olaf's reply got me to change the relation back to "1 to 1" even though there are many children... (doesn't make much sense, when it is a "1 to N" relationship. Anyway, I changed it and it now skips only the parent.

Thanks, Stanley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top