Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox Speedsearch not working for 3 chars only
Message
From
11/06/2004 16:29:48
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Listbox Speedsearch not working for 3 chars only
Miscellaneous
Thread ID:
00912914
Message ID:
00912914
Views:
50
For some reason a listbox on a form will not speedsearch the letters A, P, or Q (upper or lowercase). Yet in the table there are values that begin with those three letters. The table is a company listing and there are at least 3 entries for every letter in the alphabet. Typing 'B' will go to the first entry in the table that begins with the letter B but it will not work for a, p, or q. Any ideas?
*listbox properties
controlsource:  thisform.pr_lookup
rowsource:  PR_NAME+LEFT(PR_ADDR1,18)+' '+PR_SYSNUM+' '+trans(PR_PHONE,"@R (999) 999-9999") 
rowsourcetype: 6 - Fields
value = ''
Listbox keypress event:
LPARAMETERS nKeyCode, nShiftAltCtrl

IF LASTKEY() = 13 .or. LASTKEY() = -9
	nKeyCode = 13
	nShiftAltCtrl = 0
ENDIF

IF nKeyCode = 13 .or. nkeyCode = -9 
	NODEFAULT
	CLEAR TYPEAHEAD
	THISFORM.cmdOK.click
ELSE
	DODEFAULT()
ENDIF
Form Init:
PUSH KEY CLEAR

IF !FILE((ddir+"PR_COMP.DBF"))
	RETURN
ENDIF

SELECT 0
USE (ddir+"PR_COMP")
SET ORDER TO TAG PR_NAME
GO TOP
setnear = SET("NEAR")
SET NEAR ON
SEEK carrier.ca_name

DODEFAULT()

IF !EOF('PR_COMP')
	thisform.pr_lookup = PR_NAME+LEFT(PR_ADDR1,18)+' '+PR_SYSNUM+' '+trans(PR_PHONE,"@R (999) 999-9999")
ELSE
	IF setnear = "OFF"
		SET NEAR OFF
	ENDIF
	USE IN PR_COMP
	SELECT CARRIER
	RETURN .F.
ENDIF

IF setnear = "OFF"
	SET NEAR OFF
ENDIF

ON KEY LABEL F5 DO FORM pr_addr NAME opr_addr LINKED

THISFORM.refresh()
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform