Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AUTOCOMPLETE not complete
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
AUTOCOMPLETE not complete
Divers
Thread ID:
01491194
Message ID:
01491194
Vues:
141
I have two problems with the results of the code below which i hope someone can put their finger on.

What i am trying to do is set up a text entry box with autocomplete.

What i'm getting is alphabetic search alternatives as is supposed to happen BUT with history of previous typos and entries from previous sessions - i don't know why these text entries are being retained. So firstly how do i ammend my code to get rid of history and display only alpha listing of records?

Secondly - embarassed to admit - when i move to phase two (to jump to the rcord selected) i always end up with the top entry, How do i capture the selected entry and move the record selection to that point.

Apologies for not crediting the author of this code (adapted) and thanks to many of you for getting me this far - i have been following and appreciate the long chain of valuable advice received.

k
Close All
Public oform1

oform1=Newobject("form1")
oform1.Closable = .F.  && Disable the window pop-up menu
oform1.MinButton = .F. 
oform1.MaxButton = .F. 
oform1.Show
READ EVENTS  && Start event processing

release oForm1 
Return


**************************************************
*-- Form:         form1 (\imaginecorp\form11.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   02/02/07 01:25:12 AM
*
Define Class form1 As Form


	Top = 63
	Left = 268
	Height = 290
	Width = 422
	DoCreate = .t.
	ShowTips = .T.
	Caption = "MY ENTRY SCREEN"
	Name = "Form1"
    FontName = 'Lucida Console'
    FontSize = 9
   
    
	Add Object command1 As CommandButton With ;
		Top = 19, ;
		Left = 318, ;
		Height = 27, ;
		Width = 54, ;
		Caption = "GO", ;
		TabIndex = 2, ;
		Name = "Command1"


	Add Object label1 As Label With ;
		AutoSize = .T., ;
		Caption = "Enter Name", ;
		Height = 17, ;
		Left = 5, ;
		Top = 25, ;
		Width = 55, ;
		TabIndex = 3, ;
		Name = "Label1"



	Add Object text1 As TextBox With ;
	    Format = "K", ;
		Height = 23, ;
		Left = 80, ;
		SelectOnEntry = .T., ;
		TabIndex = 1, ;
		Top = 20, ;
		Width = 207, ;
		Name = "Text1"
		text1.autocomplete = 1
		

	Procedure Load
	
	If Used("Name")
		Use In vName
	Endif
**** Do not need to do this if there is an Index
	set exclusive on
************************************************
	Select 0
	Use c:\db\prg\Menu\mydatatable.Dbf
************************************************
	INDEX ON vNAME TO Tag Name1
	Set Order To Tag Name1 
************************************************
	Endproc


	Procedure command1.Click
	CLEAR
	Thisform.Release
    CLEAR EVENTS
    DEACTIVATE WINDOW form1
    SET ORDER TO 
    DO STEPTWO &&&&& THIS LEADS TO MAIN SCREEN OF THE SELECTED RECORD           
   return
	Endproc


	Procedure text1.Init
	If !Pemstatus(This,"nIDSelStart",5)
	This.AddProperty("nIDSelStart",0)
	Endif
	Endproc	


Enddefine


PROCEDURE STEPTWO
&&& moves program to an exisiting screen display of record
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform