Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Next button with parent / child databases
Message
From
25/05/1999 09:21:20
 
 
To
24/05/1999 22:42:11
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00222317
Message ID:
00222434
Views:
23
>I have a one to many parent-child database setup in which I am trying to use a 4 page pageframe to allow all of the input into the parent and the child.
>
>One of the four pages includes information for both the parent table and the child table. I want to leave the ability to change the parent table on the top of the page (I actually have it on the pageframe so it shows up on all four pages) and then set up a group of command buttons which will allow me to move to the next and previous records within the child table while leaving the parent unchanged.
>
>Any suggestions on how to accomplish this would be appreciated. I seem to be having trouble getting my parent table to not be the one changing.
>
>Thanks
>
>Todd

I'm going to take a couple of things for granted here, so tell me if I'm wrong. First, you have enough columns in your child table that using a grid would be impractical because your user would have to scroll back and forth in the grid. Skip In (Alias) would work, but might prove to be impractical in larger implementations. My recommendation would take a couple of more lines of code per button, but would allow a bit more flexibility ...

I would create a class based on the control foundation class and create navigation buttons to put on it. So we have a control class with cmdFirst, cmdPrevious, cmdSearch, cmdNext, cmdLast. The general code for each button (except cmdSearch) would resemble the following.

*- Navigation within CURSOR cmd??.click()
THIS.previousalias = ALIAS()
SELECT (THIS.currentalias)

*****

** If necessary test for BOF()/EOF()
** Navigate throught the cursor

*****

(OPTIONAL) Select (THIS.previousalias)

What you gain here is that you can now drop this control in anywhere you like and by filling in a single parameter you don't have to do another thing to make it work. You could also add a method on the control to enable and disable the buttons as needed. ** You will have to add the properties (previousalias & currentalias) to the control class.

Microsoft provides a number of usefull tools of this type with FoxPro, I prefer to use my own, largely because I enjoy building them.

The initial construction of such a class is a bit more complex than just dropping a button on the pageframe and going on, but the payoff comes when you need to do it again. Also, it unifies the user interface of your app which makes the users comfortable.

Just my $.02 worth.

Regards,

Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Previous
Reply
Map
View

Click here to load this message in the networking platform