The Value of current object is not save to database 
Author Message
 The Value of current object is not save to database

On the form, there are for example five Text objects.  Form bufferring
is set to 3.  When the user, key in the value of the last object, for
example:  3, and the cursor still REMAINS in the object (lostfocus
method is not fired),  the user hit F7 key (F7 is the SAVE function).
Well, the value 3 will not get saved in the table.  How can I solve the
above problem??  Can I force a lostfocus on the last Object?? How??



Sun, 20 Aug 2000 03:00:00 GMT  
 The Value of current object is not save to database

Joseph:
Create a little routine before saving your information and check this
IF TYPE("THISFORM.ActiveControl") = "O" AND it has Value property and it has
ControlSource Property and
THISFORM.ActiveControl.Value # EVAL(THISFORM.ActiveControl.ControlSource)

    m.lcVar = THISFORM.ActiveControl.ControlSource
    REPLACE &lcVar WITH THISFORM.ActiveControl.Value

ENDIF
P.S.
Use the PEMSTATUS function do determine if your control has a property

Good luck
Dmitriy

Quote:

>On the form, there are for example five Text objects.  Form bufferring
>is set to 3.  When the user, key in the value of the last object, for
>example:  3, and the cursor still REMAINS in the object (lostfocus
>method is not fired),  the user hit F7 key (F7 is the SAVE function).
>Well, the value 3 will not get saved in the table.  How can I solve the
>above problem??  Can I force a lostfocus on the last Object?? How??



Sun, 20 Aug 2000 03:00:00 GMT  
 The Value of current object is not save to database

Joseph:

A somewhat simpler solution is to force the getfocus event to fire on a
save button (if you have one on the form).  This will cause the Lost focus
event of any control on the screen to fire, and it will provide a single
place on the form to trigger a save.

For example:

ON KEY LABEL F7 =THISFORM.Command1.Click()

Assuming that Command1 is your "Save" button, this will "press" the save
button, causing the control which currently has the focus to fire it's
LostFocus() event, and will then execute the action in the command button.
If you want to be consistant between forms, always name the Save button
object something like cmd_Save so that the ON KEY will work with any form
having a save button.

Sloan


Quote:
> Create a little routine before saving your information and check this

> >Can I force a lostfocus on the last Object?? How??



Sun, 20 Aug 2000 03:00:00 GMT  
 The Value of current object is not save to database

Thanks!!  Your solution is not too difficult to implement in my project
and it works great on the TEXT object as well as the Grid object!!!

Quote:

> Joseph:

> A somewhat simpler solution is to force the getfocus event to fire on a
> save button (if you have one on the form).  This will cause the Lost focus
> event of any control on the screen to fire, and it will provide a single
> place on the form to trigger a save.

> For example:

> ON KEY LABEL F7 =THISFORM.Command1.Click()

> Assuming that Command1 is your "Save" button, this will "press" the save
> button, causing the control which currently has the focus to fire it's
> LostFocus() event, and will then execute the action in the command button.
> If you want to be consistant between forms, always name the Save button
> object something like cmd_Save so that the ON KEY will work with any form
> having a save button.

> Sloan


> > Create a little routine before saving your information and check this


> > >Can I force a lostfocus on the last Object?? How??



Sun, 20 Aug 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to get current object's value?

2. save/retrieve value from Optiongroup Object

3. This.value can't save to the database

4. Dropdown combo - typed value not saved

5. Combo Box Values Typed in not saving!!!!

6. Values NOT being saved!

7. Error <database>.dct is not an object file

8. VFP Reports Saving current default printer.

9. VFP5.0: Character fields with Null values will not accept text values

10. Objects: Am I missing the point?

11. Comboxes and current value

12. Calculating a value from current form data

 

 
Powered by phpBB® Forum Software