Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AUTOCOMPLETE in VFP9

Status
Not open for further replies.

andy0923

Programmer
Jul 26, 2002
65
US
Has anyone experienced the following behavior and possible solution?

It seems that if the length of an entry in a textbox exceeds 31, the record is duplicated in the autocomplete table. Therefore, each successive timme the mouse is clicked in the textbox, the list shows duplicate (n+1) entries.

Any help would be appreciated.
 
From the help file:
The Source field in the AutoComp table is limited to 20 characters. You should ensure that your AutoCompSource property is limited to this amount. The control's Name property is used if you do not specify an AutoCompSource value. If the source used is longer than 20 characters, it is truncated to its first 20 characters for lookup against the Source field in the Autocomp table.
So it's quite possible to have multiple entries in your scenario.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Thanks. However I think we are talking about two different things. I am using the default "textbox1" (controlname) as source. It is the DATA field, which, when length>31, ends up duplicating itself.

ANDY
 
No, I don't think we're talking about two different things. Your text box is bound to an autocomplete table or autocomplete wouldn't happen.
Since the value of the text box is longer than 20, the value gets truncated, so whatever is getting passed to the autocomplete table can get replicated.
Maybe you could USE the table and add a UNIQUE clause to it.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
It sounds quite logical what you are saying. But Im having difficulty understanding why it only truncates for data>31. Why then, according to your explanation, doesn't it truncate for values>20 (or more precisely for 20<n>31) ?
 
The Source field in the AutoComplete table allows multiple textboxes to use the same list of entries. It holds the value in the AutoCompSource field of the textbox.

Tamar
 
Hi Andy:

It should work the way you are expecting. Ther is something wrong somewhere. You can have data upto 254 Chars Long. Variable name upto 20 Chars Long. For example

txtThisisMyFirstVariableName1
txtThisisMyFirstVariableName2
012345678901234567890

They both will pickup the same data from the AutoComp.dbf table.

try expanding your TextBox Control a bit longer and observe the behavior. Try removing any format or input mask settings.

I just tested it and works just fine. So let us see where the problem is .....

waiting for your response ...

Nasib Kalsi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top