>
> Has anyone come up with a good method that will
> allow a user to cancel an operation while they are
> on a field that requires entry.
>
> They have requested to add a new record.
> The user is then presented to a screen with X number
> of fields, some of which are required and in their
> VALID code states IF EMPTY(fieldname) THEN 'Field must
> be filled' ENDIF
>
> but what if the user presses the CANCEL button, how do I
> know that they have touched the CANCEL button so
> as to let them out of the required field and let the CANCEL
> valid be fired off.
>
> Any suggestion please.
>
> Bret
Hi
1. Create a form level property or Object level property as lCancel
and set lCancel = .F.
2. In the click event of cancel button
(i). Change this lCancel property as
thisform.lCancel = .T. [form level]
OR
IF TYPE('thisform.Activecontrol.lCance') # 'U'
thisform.Activecontrol.lCancel= .T. [object level]
ENDIF
3. In the valid of each object return value after checking lCancel value.
LOCAL lRetval
lRetVal = !Empty(this.value)
RETURN IIF(lCancel,.T.,lRetVal)
Hope this may help u.
Thank Q
Waheed
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only