Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RowValid() and SetFocusField()
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
CodeMine
Title:
RowValid() and SetFocusField()
Miscellaneous
Thread ID:
00713941
Message ID:
00713941
Views:
50
I am using the RowValid() to check for required Empty fields like the CodeMine online help does in the tutorial.

It works fine, except if the field I am checking is in a Child Form (child form is based on FrmDataChildCustom and shares the cmrule with the parent form). The following code in the RowValid():
IF NOT EMPTY(m.cErrorField)
    * Display a message describing the error.
    THIS.DisplayMessage('A \c is required for this Form.', THIS.NiceFieldName(m.cWorkarea, m.cErrorField))

    * If we are in a form, this will put focus on the field with the error
    THIS.SetFocusField(m.cWorkarea, m.cErrorField)
    RETURN .F.
  ENDIF
  RETURN .T.
evidently ignores the line THIS.SetFocusField(m.cWorkarea, m.cErrorField) if it is dealing with a field on the Child Form. In otherwords, what is suppose to happen is the cursor is suppose to return to the field that was left empty. However, that does happen on the Parent Form, but not a Child Form.

Any help is appreciated.

Mel Cummings
Next
Reply
Map
View

Click here to load this message in the networking platform