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!

Nav Btn on 1-m Form w/ grid

Status
Not open for further replies.

rmcmorris

Programmer
Nov 22, 2002
42
US
I have a form containing two tables linked as one-to-many. The form contains some fields from the parent table, and a grid from the child table.

I would like to include navigation buttons which move the parent key. However, the nav buttons (using skip function) seem to only advance through the child table one record at a time. I have tried setting focus onto one of the parent key fields first, but this has no effect.

How can I skip through records on the parent table only?

Thanks,

Regan
 
Did you add those nav buttons with the form wizard? If so, you'll have some issues.
You may be able to add some code to the buttons themselves, like the 'Next' button:
Code:
SELECT TableToSkip
IF !EOF()
   SKIP
ENDIF
NODEFAULT

Otherwise, the table opened when you added the buttons will always be affected.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
I tried using both a wizard and coding a button on my own with the same problem.

I was able to fix the problem though by changing a setting in the data environment. Apparently, if the "OnetoMany" setting for the relation of the link between the parent and child tables is set to ".T.", then any navigation will automatically default to the child table. If you change the "OneToMany" setting to ".F.", then all navigation is on the parent table. This makes no sense to me, as it seems we should be able to specify which table to navigate, and calling the setting "OnetoMany" is also a bit misleading (the table link is a one-to-many relation, that is why I had specified that setting as ".T." to begin with.).

Thanks,

Regan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top