Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling Modal Child Dialog
Message
From
16/05/2002 20:03:32
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00657702
Message ID:
00657919
Views:
31
Mel:

>ERROR #2012 in Formziplook.txtstate.selfocus
>"Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event."

That's a VFP error. It is unable to set focus from a valid event. I was going to say before but I did not really want to add more confusion - what you are attempting to do ie., call a modal form should not really be done from a FieldValid method. The fieldvalid method is for just what it says - checking whether the contents of a field are valid and returning True or False - not calling another form. The FieldValid method is called by a Codemine subclassed native VFP valid event. So despite the fact that you have put your code in the datamanger fieldvalid method, higher up in the call stack is a native VFP valid.

You need to re-think where you call your modal form from.

>By chance if i need to set lReleaseOnClose = .F. down the road (for this or another need), how would I manually release the form?

Well, if you are thinking of this, you would be better changing your child form from an scx to a class and using a native VFP creatobject to instantiate the form.
local oChild
m.oChild = createobject('frmChild', thisform)
m.oChild.Show()
*1)
m.lStatus = m.oChild.ReturnValue()  && Gets the return value and releases the form or.
*2)
m.oChild.Release() && Which releases the form when you want but allows you to inspect properties of the form.
HTH
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform