I have a form with a pageframe on it. To go from one page frame to the other, the user want to use PgUp & pgDown. Fine with me. So I put the following code in the form' keypress method (The keypreview form property has been set to .t.):
IF nKeyCode = 18 && Page Up
THISFORM.Wspageframe1.ActivePage = 1
THISFORM.Wspageframe1.page1.txtPoNo.SetFocus()
ENDIF
IF nKeyCode = 3 && Page Down
THISFORM.Wspageframe1.ActivePage = 2
THISFORM.Wspageframe1.page2.ScnItem.SetFocus()
ENDIF
It works fine with the page frame BUT there is a major problem with it:
If I am on a field of the first page; I enter 1 in a field and, without doing tab, I press PgDown to go to the second page; The 1 is in limbo somewhere and is not in my field value (still showing 0). From a suggestion, I even added this.value = this.value in the field valid method. No success. SO I said that I just need a tab and I modified the code for the following:
IF nKeyCode = 3 && Page Down
KEYBOARD '{TAB}' && To force a valid value
THISFORM.Wspageframe1.ActivePage = 2
THISFORM.Wspageframe1.page2.ScnItem.SetFocus()
ENDIF
No more sucess....
Any idea ?
Thanks
Eric