Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving in a grid
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00459533
Message ID:
00459757
Views:
25
>>>>>>>>>>>
>i have a grid with about a 100 rows, i want to use the ENTER key to enable the user to move to the start of a new row when he reaches the last column.
>at present it come to the start of the same row. the row does not change.
>>>>>>>>>>>>
>In the last comlumn's textbox LostFocus event put:
>
>    thisform.grid1.AllowAddnew = .t.
>
>And in the gotfocus event of all other column (textbox) put:
>
>
>      thisform.grid1.AllowAddnew = .f.
>
>With this you need to use the down-arrow instead of the ENTER key but it works.

You can automate the records adding with this code in last column textbox.KeyPress():
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 13 && Enter
	APPEND BLANK IN (this.parent.parent.RecordSource)
	keyboard '{DNARROW}'
	this.parent.parent.column1.SetFocus()
ENDIF
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform