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.
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.