Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp 5.0 update fields
Message
From
21/09/1997 18:26:46
 
 
To
21/09/1997 18:15:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00050979
Message ID:
00050980
Views:
22
>the last edit box in a form is connect to a field in a table. Unless the user presses enter after the last edit box the data will not always be entered into the table with =tableupdate()
>
>is there a solution to this problem?

Yes, you need to flush the buffer to the table before calling the Save() method. This is from the search:

One more time, here's the fantastic WriteBuffer() method.
* Save the current buffer
* Call from Save() and AddNew()
* We need to make sure the hierarchy is not coming from a Valid() event
* because this will generate an error
* In Visual FoxPro 5, we are not allowed to call SetFocus() from a Valid() event
LOCAL lcProgram,lnCompteur
lcProgram=PROGRAM(1)
lnCompteur=2
DO WHILE LEN(lcProgram)>0
   lcProgram=EVALUATE('PROGRAM('+ALLTRIM(STR(lnCompteur))+')')
   lnCompteur=lnCompteur+1
   IF UPPER(RIGHT(lcProgram,6))='.VALID'
      RETURN
   ENDIF
ENDDO

IF TYPE('_Screen.ActiveForm.ActiveControl')='O' 
   IF UPPER(_Screen.ActiveForm.ActiveControl.BaseClass)=='GRID'
      * Test if this is an active grid column
      IF _Screen.ActiveForm.ActiveControl.ActiveColumn<>0
         IF UPPER(EVAL('_Screen.ActiveForm.ActiveControl.Columns(_Screen.ActiveForm.ActiveControl.ActiveColumn).'+; TRIM(_Screen.ActiveForm.ActiveControl.Columns(_Screen.ActiveForm.ActiveControl.ActiveColumn).CurrentControl)+;
           '.BaseClass'))='OPTIONGROUP'
            _Screen.ActiveForm.ActiveControl.SetFocus()
            ELSE
=EVAL('_Screen.ActiveForm.ActiveControl.Columns(_Screen.ActiveForm.ActiveControl.ActiveColumn).'+; TRIM(_Screen.ActiveForm.ActiveControl.Columns(_Screen.ActiveForm.ActiveControl.ActiveColumn).CurrentControl)+;
              '.SetFocus()')
         ENDIF
      ENDIF
      ELSE
      _Screen.ActiveForm.ActiveControl.SetFocus()
   ENDIF
ENDIF
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform