Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto complete entry
Message
From
12/05/2010 17:54:03
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01464082
Message ID:
01464364
Views:
75
I came across a working model posted by Cetin see below - which works very well.
Since the textbox is now in place in code, i tried inserting the command that should invoke the autocomplete: (the autocomplete should in fact trace what cetin has set up in the grid below the textbox in the form. While Cetin's code continues to work splendidly, the autocomplete still does not appear in the textbox - what am i missing?

Cetin - are you there buddy?

k

Add Object txtSearch As TextBox With ;
txtSearch.autocomplete = 1 &&&& i tried adding this without success
Public oForm
oForm = Createobject('myForm')
oForm.Show

Define Class myForm As Form
DataSession = 2
Top = 0
Left = 0
Height = 400
Width = 750
Caption = "Search Test"

Add Object lblSearch As Label With ;
Left = 5, Top = 5,Width=60,Caption='Company'
Add Object txtSearch As TextBox With ;
Left = 70, Top = 5
txtSearch.autocomplete = 1  &&&&   i tried adding this without success!!
Add Object myGrid As Grid With ;
Height = 300, Width = 750, Top=30

Procedure Init
With This.myGrid
.RecordSourceType=4
.RecordSource = "select * from customer "+;
" where UPPER(company) = UPPER(TRIM(thisform.txtSearch.Value))"+;
" into cursor crsCustomer"
Endwith
Endproc

Procedure txtSearch.Interactivechange
With This.Parent.myGrid
.RecordSource = .RecordSource
Endwith
Endproc
Enddefine



***http://www.databaseforum.info/18/1058133.aspx
>I can run the code as is and play with it. But you just need to use the ideas from it in your form.
>
>Also, why do you need to use this code instead of built-in AutoComplete? All you have to do is to set AutoComplete property of the textbox to true.
>
>>could not get the textbox running - after trying to set it up in new form - a little over my head i think.
>>
>>I came across this code in http://tek-tips.com/faqs.cfm?fid=6540
>>it seems to be what i'm looking for but it breaks down pretty quick after here "Define Class form1 As Form" with error messages:.oform1 is not an object etc. am i wasting my time to try and adapt this?
>>
>>any help appreciated with thanks
>>k
>>
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform