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:
00098747
Views:
38
>>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, I use multiple tables & 1 set of buttons all the time. My Activate() method for each pageframe page sets my ActiveAlias property with the DBF which is active on that page. This value is called in the Add/Delete buttons, so the correct table is always active.
>
>In one case, where I had parent and child records added on the same form (not on separate pages), I re-set the ActiveAlias method when I clicked on the grid showing child data.
>
>HTH
>Barbara

Barbara -

Thanks, you had given me this tip originally I think, and that is working fine. However, my current problem is two fold. 1) I am using buttons which set a c_masteralias property, so first of all they were always trying to operate on whatever that was. I found this wasn't a problem and was able to perform all the functions until I got to deleting. The delete method's click event assumes we're dealing with one table, so when it deletes the current record, it them displays the next record. This is incorrect, because the next record doesn't belong to that parent. It is in fact the child of the next record. So this basic delete button is insufficient for this kind of scenario. I thought originally it would be a matter of changing the c_masteralias property, then doing the default method, but as you can see, that won't work in this situation. So now it seems like my two choices were to do a Case statement that says either do the default if it is the master alias or do this other custom code which deals with the child. I was trying to avoid that, and that's why I was wondering if my idea was a bad one.

The second problem is adding those child records to the second page, and someone had suggested using another button to deal with just this scenario. Again, it made me wonder am I overcomplicating.

It sounds like you're doing this. Do your buttons do this kind of DO CASE situation to deal with the differencesb between the parent and child? Choosing the correct alias is one thing; dealing with the behavior after you've got the alias is another.

Thanks,

Sylvia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform