Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object not found
Message
From
29/07/2005 18:47:34
 
 
To
29/07/2005 17:27:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01037164
Message ID:
01037178
Views:
26
On a activate method for a page (4 pages on a single pageframe) I have code like

ON KEY LABEL F9 thisform.DoSomething

where DoSomething method contains

Invoice.pageframe1.page3.cmdAction.click (invoice is a form name, cmdAction is a command button)

First time I press F9 on a page everything works fine and code under command button executes. Code under command button is nothing special and strange.

Second time (and so on) pressing F9 cause fox error
"Object 'invoice' not found"


And now you know first hand why OKL's are not a very good idea. The reason is that they interrupt whatever code happens to be running at the time and execute - something that may have unpredictable results. A better idea would be to set the form's KeyPreview property to true and put code like this in the form's KeyPress() method:
IF nKeyCode = -8  && F9
  thisform.DoSomething()
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform