Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Edit control's .Value or .Text not always available
Message
From
08/11/2006 14:29:18
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Edit control's .Value or .Text not always available
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01168202
Message ID:
01168202
Views:
78
Hi Everyone,

Users get the odd error on a multi-page form when I try to validate an editbox control on page 1 of the form. The validation is in the "Save" method and for some reason it seems .Value or .Text cannot be evaluated. The form is still open when the .SaveBeforeAnything() method fires:

Here is the code abbreviated:
WITH THISFORM.pgfDEForms.Page1

*** other checks ...

* Debug: check the ".text" property not the .value property as the .value property can cause a bomb

IF EMPTY(.edtOpeningComments.Text)  && here is where it fails
Error logged: #1113 "File is not open." The cursor is indeed open so it is not a case of the view not being open yet.

I used to check property .Value but that seemed to occasionally cause crashes. So I switched to .Text but it too has the odd prob. Note that I moved away from checking the underlying view (v_Qotes.OpeningComments) as it seemed that checking the .Value of controls was overall more "accurate" and always up to date (I had instances where the cursor did not immediately reflect the value of the control and so I moved to always querying the control for anything I needed).

Stepping through the code, at times the control's .text or .value can be evaluated and at other times it cannot (I think maybe the debugger is being thrown off by tabbing back and forth between it and the VFP session).

What's up with this behaviour?

TIA,

Albert
Next
Reply
Map
View

Click here to load this message in the networking platform