Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Going to next line in Grid
Message
From
04/01/2000 09:26:30
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00312279
Message ID:
00312347
Views:
24
Hi Mark.

>> Is there a way to make the focus go to the next record automatically. I tried putting a SKIP in the Valid event of the last column but it doesn't work. Also, the file has a bunch of empty records in it if you were wondering whether there where any records after the current one. <<

Put this code in the keyPress method of the textbox in the last grid column. If the columns are movable, it will fall over if the user moves the last column ;-)
LOCAL lnMaxRows

IF nKeyCode = 9 OR nKeyCode = 13
  WITH This.Parent.Parent
	SKIP IN ( .RecordSource )
        lnMaxRows = int ( ( .height - .headerheight - iif( inlist( .scrollbars, 1, 3 ), sysmetric( 8 ), 0 ) ) / .rowheight )
	IF .RelativeRow >= lnMaxRows
	  .DOSCROLL(1)
        ENDIF
	.ActivateCell( .RelativeRow + 1, 1 )
  ENDWITH
ENDIF			   
Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform