Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto complete entry
Message
From
13/05/2010 02:43:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01464082
Message ID:
01464382
Views:
66
maybe i have the wrong idea of what's supposed to happen. autocomplete i thought would function the same way as it does in Outlook - that is to say with complete name entries appearing as a drop down below the text box. with the sample below, i am only getting a couple of letters at a time, nothing you can click on to complete the entry. Is this what it's supposed to do??

k


>This works for me except that I see little t bellow the textbox if nothing is typed.
>
>
>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, autocomplete = 1  &&&&   i tried adding this without success!!
>Add Object myGrid As Grid With ;
>Height = 300, Width = 750, Top=30
> Procedure Load
>        If Used("customer")
>            Use In customer
>        Endif
>        **** Do not need to do this if there is an Index
>        Set Exclusive On
>        ************************************************
>        Select 0
>        Use Home()+"samples\data\customer.dbf"
>        ************************************************
>        Index On company Tag company
>        Set Order To Tag company
>        ************************************************
>    Endproc
>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
>
>
>
>>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