×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

text AutoComplete

text AutoComplete

text AutoComplete

(OP)
hi all
this code i put in InteractiveChange...
The code
========
SET SAFETY OFF
SELECT itemname,itemid FROM itemss WHERE ALLTRIM(UPPER(this.value))$ALLTRIM(UPPER(itemname)) INTO CURSOR crs_city
CREATE TABLE MySource (Source C(20),Data C(254),count I,Weight I,Created T,updated T,user M)
INSERT INTO MySource (Source,Data,count,created,updated) ;
SELECT "TXT",; && usually the name of the textbox, the value of AutoCompSource
itemname,; && values from your table
itemid,DATETIME(),DATETIME() from crs_city
USE IN MySource
thisform.text1.AutoComplete= 1
thisform.text1.AutoCompTable="MySource"
thisform.text1.AutoCompSource=ALLTRIM("TXT")
LOCAL nLocID, nValue, llok, cOrder
=========================================
For a problem when you start typing the letter in the text box appear words in the drop down drop down words begin with the letter written
I want the words to appear in the beginning of the written letter and in the center of the written letter and the end of the written letter.
Thanks for the help me

RE: text AutoComplete

Are you creating the AutoComplete table in the InteractiveChange method of the textbox where you want it to appear? That's way too late.

If your goal is to create the AutoComplete table as late as possible, try doing it in the textbox's GotFocus method.

Tamar

RE: text AutoComplete

So you are actually creating the table every time the user hits a key? And then overwriting it with a new table on the next keystroke? That can't possibly be right. Apart from a huge performance hit, you will be losing the very data that you want to save.

If you want a custom auto-complete table, create it at the outset, for example when the app loads, or more likely when you install the app.

Also you need to explain your goal a bit more clearly. I, for one, don't understand "in the text box appear words in the drop down drop down words begin with the letter written:.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: text AutoComplete

Autocomplete (textbox.Autocomplete) modes will never allow you to do that. Even in "User defined weighted order".

Using a combobox you might get there quite simple by using a ComboBox in the default style of 0 (Dropdown combo) will allow the user to type a value like in a textbox or pick a value from the list you specify as RwoSource. Use Rowsourcetype fields and then aliasname.field as RowSource and then in the InteractiveChange event do

CODE

Local lcFiltervalue
lcFiltervalue = This.Value
SET FILTER TO "&lcFiltervalue" $ field IN aliasname 

I'll skip the long explanation why to use macro substitution within quotes, it's necessary so the filter expression itself is using a string literal and no variable name which would need to stay in scope, which local variables won't. This.value won't work out for the same scoping reason. The filter expression is not only applied just once when you SET it, so its scope has to be universal and not depend on something else but the expression.

This won't automatically expand the list, but the user can type some letter or letters and then when expanding find the values having these anywhere inside as pickable items. This will only work nice and smooth when your list is short enough.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: text AutoComplete

(OP)
Thank for All
I think I did not find my cause because the language of Visual FoxPro does not support typing in the textbox and show the word with results

RE: text AutoComplete

If the PDF is too much for you: First of all I think you don't find what you want with autocomplete feature of a TextBox, as the base of what you want is not even a textbox but an EditBox.

The Intellisense features are about either the native Memo editing Window or Editbox, not Textbox and you can use them not only for code but also normal Text and things like a dictionary or text blocks or spelling or word suggestions with "comboboxes" appearing automatically.

If you don't think about texts you might get what you want with textbox autocomplete table designed differently or swapping it out just in time. I doubt that works very seamless, though.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close