Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Turn New/Delete button off for Child Table
Message
From
10/10/2002 04:06:53
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00709581
Message ID:
00709718
Views:
13
Hi Mel:

>I am pretty sure I would use the IsNewAllowedRule() event for this, but can't figure out the code.

Yes, you could use this method. Also, back to our old friend IsEnabled() (which calls IsNewAllowedRule in its default code for the "New" method), you could say something like :-
Function Form.IsEnabled
... 

Case m.cMethod == 'New'   && Dealing with the New method.
If m.cWorkarea == 'Childtable'
   If Thisform.IsNew('ParentTable')
      *-- We have an un-committed new parent record so disallow new for "Childtable".
      Return .F.
   Endif
Endif
Return .T.
Obviously, this is the sort of code you could put in the IsNewAllowedRule method.

HTH
-=Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform