Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ENTER (if you dare!!!)
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01161171
Message ID:
01161176
Views:
15
LPARAMETERS nKeyCode, llSearchNumbersOnly
LOCAL llRecJump

llRecJump = .F.
DO CASE
CASE nKeyCode = 3							&& Ctrl + C
	THISFORM.p_Buffer = ""
	THISFORM.cntActions.txtDrugFilter.VALUE = ""
CASE nKeyCode = 13							&& Enter
	THISFORM.grdProfile.SETFOCUS
	Thisform.Refresh
CASE nKeyCode = 32							&& Space
	THISFORM.p_Buffer = THISFORM.p_Buffer + " "
	llRecJump = .T.
CASE (nKeyCode = 7) OR (nKeyCode = 127)		&& Backspace or Del
	IF LEN(THISFORM.p_Buffer) > 0
		THISFORM.p_Buffer = LEFT(THISFORM.p_Buffer,(LEN(THISFORM.p_Buffer) - 1))
		llRecJump = .T.
	ENDIF
CASE BETWEEN(nKeyCode,33,126)				&& Printable chars
	IF BETWEEN(nKeyCode,48,57)				&& 0 - 9
		THISFORM.p_Buffer = THISFORM.p_Buffer + CHR(nKeyCode)
		llRecJump = .T.
	ELSE
		IF !llSearchNumbersOnly
			THISFORM.p_Buffer = THISFORM.p_Buffer + CHR(nKeyCode)
			llRecJump = .T.
		ENDIF
	ENDIF
ENDCASE

RETURN llRecJump
And the grids name is grdProfile (not what I said earlier....)

Thanks!

>It sounds like you are filtering out the CHR(13). Can you post the Keypress code?
>
>Glenn
>
>>Hello Gurus!
>>
>>Thanks for the help yesterday! You guys (and ladies!) are great!
>>
>>Now, onto todays question.
>>
>>I have some data entry objects on a form... don't we all???
>>
>>In particular, I have a textbox, where as the user types in a string of data, EACH character is intercepted by a KEYPRESS event and analyzed.
>>
>>If it is a character, it is added to the string and used to FILTER a grid above the textbox, so the user can see in realtime a filterd look at the data (and it is FAST too....).
>>
>>OK... now we want to allow the user to JUMP directly to the grid (so they can move through the rows and select the ones they want to work with) IF they type in an ENTER key at the end of the string. Right now, it doesn't jump up there, even if I intercept the ENTER key (char 32) and do a SETFOCUS on the grid.
>>
>>The txtbox is named txtDrugFilter
>>and the grid is called grdPrescriptions
>>
>>Any ideas? Thanks in advance!!
>>
>>Tommy (and Karen)
Tommy Tillman A+ NetWork+ MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform