Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using multiple tables in page frames
Message
From
11/05/1998 15:52:40
 
 
To
31/03/1998 17:30:17
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00088515
Message ID:
00098564
Views:
43
>>
>>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)?<
>
>In similar situations, my trick has always been to force an INSERT into the main table (names) and 1-to-1 children (addresses), Activate the name page, and SetFocus to the first entry field....Make the Add button ALWAYS assume add name and start with name page:
>
>*** cmdAdd.Click()
>THISFORM.pgfMain.ActivePage=1 && Or whatever page# appropriate
>THISFORM.pgfMain.txtFirstName.SetFocus
>THISFORM.Refresh
>
> 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?
>
>
>The save button should save both name and address.
>
>>
>>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
>
>
>Where this gets complicated is if you want to have multiple addresses for a single name...in that case, an "Add Address" button should be on the address page specifically and NOT on the main page (it's a scope issue)

John -
Well, I'm still working on this, and everything seemed to be working until I tried to delete a record. First the delete button assumes I'm trying to delete from the master table, then I fixed that by temporarily changing the property it the assumed mastertable to the table I want, but the delete didn't pay any attention to the fact that it should only delete child records of the parent, not other parent's children. It was at that point I went back to look at the responses I got and re-read your message about the 'scope' issue. Can you explain what you mean by this in the context of this issue (i.e. I want to be able to add and delete multiple addresses from one parent at a time)?
Sylvia
Previous
Reply
Map
View

Click here to load this message in the networking platform