Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using multiple tables in page frames
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00088515
Message ID:
00089147
Views:
29
Yep, it sounds like you're one step higher on the complication ladder than me. I always suspected losing focus would be a big headache in VFP. But I appreciate your tips. Are you using a grid on any of your pages? I think I'm running into a grid property control conflicting with a Set relation command in my load event resulting in a "Cyclic relation" error.

>I'm doing something similar except I have 6 pages using the same command buttons. Each page is related to the other. I'm using buffering that is controled by a single object I add to the form in the load event. This code controls the buttons, enables/disabled buttons based on the page and calls the appropriate save/edit delete etc from one location. Being so large, it has taken many hours to get it right and from reading the other responses to this most of them are doing about the same thing.
>
>Be aware - if you use the activate event on the page frame to enable/disable buttons and you leave that form for any reason, (say to call a modal form to add something) then the activate event will fire when you return.) You'll have to write code to get by this. The other caution is debugging. I always add a bit of code like the following to get by when I am debugging.
>
>in thisform.pageframe?.page2.activate
> if type('ISDEBUG') != 'U' .and. type('ISDEBUG') = .f.
> return
> else
> your page activate code here.
> endif
>
>using this will allow you to debug. When you leave the form in the debugger, the page loses focus. In the command window you can create a global var called isdebug and set it to .f.. When you return to the form, the code will simply 'return' and not hit page activate event.
>
>Have fun!
>
>
>
>>All the samples I've seen involving creating a name and address table assume that a) the info is all in the same table and b) it will all fit on the same page. I have a separate name and an address table. Each record of info contains enough information to require its own page. That's why I decided to create a 3 page page frame. Page 1 contains all the info required for the names, page 2 for the address (and I'm allowing for multiple types of addresses - home, business, etc), and I have a grid on page 3. To complicate matters, I'd like to use the same set of buttons (i.e. have them on the form instead of on each page of the grid). I have the tables linked by a 'peopleid'. But in trying to figure out how to get the adds and saves to work I see various problems:
>>
>>How do I make sure someone adds a name before they try to enter an address (I do have RI code to restrict this in the DBC but not sure how it's going to impact my attempt at adding on the form)? How do I choose the right table to be saved when I'm flipping from page to page (e.g. what if I've already added the names in a previous visit), and am in an edit mode and want to add another address)? That is, how does the save button know "Oh, she's on page two, she wants to save a record in the address table." Or, since the records in these two tables are related, should I play it safe and just save both tables?
>>
>>Sorry for this long problem description, but I'd really appreciate any help or direction on where I go to look for help (samples and Tasmanian traders didn't do the trick in this case!).
>>
>>Sylvia
Previous
Reply
Map
View

Click here to load this message in the networking platform