Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using multiple tables in page frames
Message
From
31/03/1998 17:30:17
 
 
To
31/03/1998 16:20:52
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00088515
Message ID:
00088527
Views:
39
>
>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 Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform