Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to move down one line after entered a record in a gr
Message
From
19/04/1999 10:30:57
Dennis Schuette
Customized Business Services, Llc
Yuma, Arizona, United States
 
 
To
18/04/1999 04:22:08
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00209369
Message ID:
00209666
Views:
14
This is a sample of some code I used just last week. The only problem is that if the user presses Down Arrow in column2,3,4..., the focus sometimes stays in that column. If you fix that problem, please let me know. Hope this helps:

**Use this If/Endif for each column's Text1 control
** user pressed Down Arrow on last record
if nKeyCode=24 and recno()=reccount()
select (alias)
append blank && add a blank record
go bottom
This.Parent.Parent.Refresh() && refresh grid
**set focus to Column1 regardless which column user was in when Down Arrow was pressed
This.Parent.Parent.Column1.Text1.SetFocus()
endif

**Use this If/Endif for the LAST column's Text1 control
**if user presses ENTER on last column of last record,
** reassign to Down Arrow so new record will be appended
if nKeyCode = 13 and recno() = reccount()
nKeyCode = 24
endif
This.Parent.Parent.Column1.Text1.KeyPress(nKeyCode)
Dennis Schuette
Previous
Reply
Map
View

Click here to load this message in the networking platform