Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using multiple tables in page frames
Message
From
12/05/1998 12:27:41
 
 
To
11/05/1998 15:56:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00088515
Message ID:
00098793
Views:
34
>>>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
>>
>>I do something similar to what your looking for in a system I'm currently writing. I have a floating toolbar that has buttons on it like Add, Edit, Next, Back, Find, and Exit. When I'm in Edit mode, either from Adding a new record or Editing an existing record, I disable all the other buttons, not allowing the user to move or exit until they have either Saved or Canceled the current record. Then, I also disable all of the other pageframe tabs that the user is not using. That way they don't have the option of going to another page and/or another table.
>>
>>If you need more information on this, let me know.
>>
>>John Henry
>
>John -
>
>Can you tell me how you're dealing with deleting child records (i.e. how your delete button works)? My issue (in the context of using one set of buttons to handle two different tables - starting to look like a bad idea?) is that I want to allows multiple addresses for each name. However right now I'm just trying to adapt my delete button so it works one way in deleting the parent and another in deleting the child (i.e. I don't want delete to delete other parent's children).
>
>Thanks,
>
>Sylvia

Sylvia

This may not help you, but the way I am handling this is on my First page, all my fields on that page are attached directly to the table. Then, all remaining pages have fields that come from a View. I created a view for each page that only displays the child records attached to the parent record on page 1. This way, I don't ever have to worry about deleting the wrong records, as the only ones that are available on all pages other than page 1 are the correct related child records.

In my Activate Method on each page, I select the correct alias, which on all pages other than Page 1, the alias name is the name of the view. If the alias is a view, I then do a REQUERY(), which redisplays all child records. Then, in the Delete method of my button, all processing is the same. I just delete the record of the current alias, set a few flags, then set my record pointer to the closest record.

I like this method because the SQL views are fast, and I don't have to keep track of where I am in that table. The view does that for me.

Let me know if you need any more information.

John Henry
John Henry
State of Michigan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform