Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making Date Entry Required ??
Message
From
17/05/2006 23:00:00
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Miscellaneous
Thread ID:
01123023
Message ID:
01123089
Views:
49
Thanks for the advice. I've got the PreSaveHook working but I'm still having problems with the VALID.

I put the following code in the VALID method and thought it would prevent
the focus from changing to the next field/control until data was added to
the "UnitNo" textbox. However, the textbox still looses focus. Any
suggestions on how to keep the focus locked on the textbox until data is
input.

I also replaced the RETURN with a .setfocus command but got an error that
this was not allowed in a VALID method.
IF EMPTY(ALLTRIM(thisform.txtEmergency_UnitNo.Value))
   WAIT WINDOW "Unit Number is Required for ALL Emergency Orders!" TIMEOUT 2
   RETURN
ENDIF
Thanks,
Robert

>Exactly as you described and Fred said. You need both places - textbox >valid and PreSaveHook. If you don't want to notify user right away, you may >program your validation only in PreSaveHook. In the MereMortals framework >you create business rules for business objects and they are invoked when >data are trying to be saved.

>What is the simplist way to always ensure that data is entered into a textbox on a form?
>
>If the textbox looses focus, I want to alert the user to the of the requirement. Likewise, I want the user to be notified of this requirement when they try to save the record even if the textbox has been skipped and never received focus. In other words, I want to prevent the user from saving the record until data is added to the textbox.
>
>I've made a couple of attempts writing code to check if the .Value of the txtbox is EMPTY() but this isn't working too well. Is there a better way?
>
>Thanks,
>Robert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform