grid.txt.values VS. table.values 
Author Message
 grid.txt.values VS. table.values

I ran across a troublesome problem while testing.

I have a grid 'grdA' tied to a table 'tableA'.  Upon entering a value into
'grdA.Text1', the user presses the 'F5' key to perform some operations on
the data.

I discovered that if I neglected to hit the <ENTER> key before I pressed
the 'F5' key then the value in the grid did not match the value in the
underlying table.  ie. 'grdA.text1.value # tableA.fieldvalue'

A simple answer is not to expect the table value to be correct and use only
'This.Value' in all the calculations and updates.  Is this good, bad, or
ugly.

Am I missing something here?

Regards,

Chip O'Neal



Sat, 07 Oct 2000 03:00:00 GMT  
 grid.txt.values VS. table.values

Chip,

The value of a textbox is not committed to the table field until the textbox Valid event
occurs. You can either SetFocus() to some other control or to the textbox itself at the
beginning of the calculate routine to get the field value updated.

df    - (Microsoft FoxPro MVP) http://www.geocities.com/ResearchTriangle/9834/

Quote:

>I ran across a troublesome problem while testing.

>I have a grid 'grdA' tied to a table 'tableA'.  Upon entering a value into
>'grdA.Text1', the user presses the 'F5' key to perform some operations on
>the data.

>I discovered that if I neglected to hit the <ENTER> key before I pressed
>the 'F5' key then the value in the grid did not match the value in the
>underlying table.  ie. 'grdA.text1.value # tableA.fieldvalue'

>A simple answer is not to expect the table value to be correct and use only
>'This.Value' in all the calculations and updates.  Is this good, bad, or
>ugly.



Sun, 08 Oct 2000 03:00:00 GMT  
 grid.txt.values VS. table.values

Thanks,  I had 'This.SetFocus()' put into the code and it worked.  I saw
the suggestion on one of the other answers and tried it yesterday.  Thanks
Again.

Chip



Quote:
> Chip,

> The value of a textbox is not committed to the table field until the

textbox Valid event


Mon, 09 Oct 2000 03:00:00 GMT  
 grid.txt.values VS. table.values

This same problem happens if you use a toolbar and buffering.  What I
did to combat the problem is drop a command button on the form and
push it beyond the sceen boundries in the forms init method so it
dissapears.  

When the user presses the F5 key, set focus to the command button
first before you 'perform some operation on the data'.  This will
update the record/field.

You can test to see if this is the problem by just clicking on
something outside the grid and then back again before you press F5
(assuming new data has just been entered here).  

Hope this helps.

On Tue, 21 Apr 1998 16:26:11 -0700, "Chip O'Neal"

Quote:

>I ran across a troublesome problem while testing.

>I have a grid 'grdA' tied to a table 'tableA'.  Upon entering a value into
>'grdA.Text1', the user presses the 'F5' key to perform some operations on
>the data.

>I discovered that if I neglected to hit the <ENTER> key before I pressed
>the 'F5' key then the value in the grid did not match the value in the
>underlying table.  ie. 'grdA.text1.value # tableA.fieldvalue'

>A simple answer is not to expect the table value to be correct and use only
>'This.Value' in all the calculations and updates.  Is this good, bad, or
>ugly.

>Am I missing something here?

>Regards,

>Chip O'Neal

----------------------------------------------
Spam Hater: Please remove the 'x' from the email to respond
email:  mrlmz AT apci DOT net


Mon, 09 Oct 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. change value in table depending on values in other table

2. update values in table A from values in table B

3. This.Value vs Table.Field

4. This.Value vs Table.Field

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

6. How to convert Filer.Dll DateTime, LastWriteTime and LastAccessTime values to VFP dateTime values

7. Numeric field: how to distinguish between no value and 0 value

8. ListBox Value Property = List Item or Actual Value?

9. Store a Value to specificly numeric and a question about Value of txtBox

10. Recalculating table with values from other table

11. Insert values from one table into another table.

12. Please help me update the values in one table with values from another table....

 

 
Powered by phpBB® Forum Software