Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create simple autocomplete form
Message
From
19/12/2013 15:41:29
 
 
To
19/12/2013 14:58:23
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01590652
Message ID:
01590657
Views:
60
Thanks Mike that is the actually same model I had adopted and was trying to adapt it
I dont understand the 'cast' part and was getting error reads from the outset of that portion.
I take it then that this part is required to get the autocomplete to work.
In that case I would need a translation of the code in order to adapt it practically to my file and field name.
mydbf,dbf with name field vname. if you could provide some guidance there I would appreciate it.

thanks
k

>>Can anyone please give me hand in the right direction. I am going to start fresh on this since my old autocomplete programming is not working very well.
>>So I will do this properly using a form - first of all can I get to work (see below)?.
>>
>>I am using mydbf.dbf and am trying to get autocomplete of field name Vname.
>>on selection do something.
>>
>>Appreciate it if you could fill in the great many blanks to get this going. I can flesh it out once the mechanism is working.
>>many many thanks if you can get this going it's becoming a thorn in my side.
>>k
>>
>>
>>Public oForm
>>oForm = Createobject('AutoCompleter')
>>oForm.Show 
>>
>>Define Class AutoCompleter As Form   
>>Add Object Sname As TextBox With top=10, Left=10,;
>>AutoComplete = 1,;
>>AutoCompTable = 'mydbf',;
>>AutoCompSOurce = 'Vname'
>>Enddefine
>>
>
>Hi Karen
>
>Here's a simple example based on stuff Cetin Basoz has online.
>
>You could create the following table in a shared location.
>
>
IF NOT FILE("myAutoCompCountries.dbf")
>Select ;
>	CAST('MyCountries' As c(20)) As 'Source',;
>	CAST(country As c(254)) As 'Data',;
>	CAST(1 As Int) As 'Count',;
>	CAST(0 As Int) As 'Weight',;
>	DATETIME()-60 As 'Created',;
>	DATETIME() As 'Updated',;
>	CAST('' As m) As 'User' ;
>FROM ;
>	(_samples+'data\country') ;
>INTO Table ;
>	myAutoCompCountries
>USE IN 'myAutoCompCountries'
>ENDIF
>
>*Then the form looks like this...
>
>*I rarely use public in production, but without it, this sample will end as soon as it reaches the last line of code.
>
>Public oForm
>oForm = Createobject('AutoCompleteCountrySample')
>oForm.Show
>
>Define Class AutoCompleteCountrySample As Form
>   Add Object txtCountry As TextBox With top=10, Left=10,;
>      AutoComplete = 1,;
>      AutoCompTable = 'myAutoCompCountries',;
>      AutoCompSource = 'MyCountries'
>Enddefine
>
>Hope that's enough to get you going.
Previous
Reply
Map
View

Click here to load this message in the networking platform