PRB: Current Edit Not Saved with TABLEUPDATE() from Toolbar (139155)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
This article was previously published under Q139155 SYMPTOMS
Using the TABLEUPDATE() command in a toolbar command button click event
while row or table buffering is enabled does not save the current object's
value.
CAUSE
When you click a toolbar command button, the focus never leaves the object
on the form. Therefore, any changes that are made to that object are not
sent to the buffer.
RESOLUTION
The following code sample is very generic and only handles edit and text
boxes. The code must be modified for combo boxes and grids containing text
boxes, edit boxes, and combo boxes. Note that with combo boxes, you will
have to use the DisplayValue instead of Value.
Add the following code to the Click event of the Toolbar command button:
*-- Code begins here
IF ;
INLIST(_screen.ActiveForm.ActiveControl.BaseClass,'Textbox','Editbox')
REPLACE (_screen.ActiveForm.ActiveControl.ControlSource) ;
WITH _screen.ActiveForm.ActiveControl.Value
ENDIF
=TABLEUPDATE()
_screen.ActiveForm.Refresh
*-- Code ends here
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 2/11/2000 |
---|
Keywords: | KB139155 |
---|
|