Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code not running in grid.column.text.valid

Status
Not open for further replies.

jmueller

MIS
Oct 9, 2001
57
US
Can anyone tell me why the code I put in the VALID snippet of the Grid.Column.Text.Valid doesn't run? (it also doesn't run when I put it in the Keypress or LostFocus snippets). I'm using VFP6.

Thank You!
 
jmueller

There must be a reason for this behavior. This is not normal. Are re-contruction your grid? Resetting your grid.recordsource with an SQL statement?


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
The code gets read if I am working with a "populated" recordsource but NOT when i'm working with an empty recordsource. In other words it doesn't work when I append a blank record to the recordsource just before the grid receives focus. After the data is entered into the last column of this first row, I want one of these snippets to append another blank record and place the cursor in this new rows first column but they don't get read.

Any thoughts?
 
jmueller

When you append a record in a buffered table, you will notice that the recno() is -1, which means that the record does not really exist at that point, and will not trigger and valid event until it actually exists. If you want to just add a new row to your grid at the last column, set your allowAddNew to .F., but change it to .T. at the last column, allowing you to use the downarrow to create a new record, and in the Keypress event if you need to do some validations, check for nKeyCode = 24.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks Mike... I just replied to you in the wrong thread! See thread 184-530629 for my response. :) Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top