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.