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!

Auto Complete problems

Status
Not open for further replies.

EmmaLu

Programmer
Jul 16, 2004
38
US
Hello,
I love the new AutoComplete properties in VFP9. But I have fould a couple of problems.
1)Sometimes when a users selects an entry from the drop down list that is more than 30 characters a duplicate record with that entry is added to the list?
2)Is there any way short of making the AutoCompleteTable read-only to prevent some users from adding to the the list of entries when they type unlisted text in the field?
Thanks
 
30 char is long for all Upper or All Lower so is the Problem a case issue?
Is there a Format & Inputmask for the field?
Can you put a Proper() in the valid method and replace the value before the valid check?


David W. Grewe Dave
 
I don't think it is a case issue. I changed the entries in the AutoCompleteTable to ALL upper case and still have the problem. There is nothing in the Format or Input Mask for the field and Proper() in the valid method doesn't help.

These AutoCompleteTables are dealt with in a special way by VFP. They must have an index somewhere but I don't know where it is stored. If I create my own CDX for the table then the AutoComplete function stops working.

I wish there was a setting to restrict text typed in the field from automatically being added to the associated AutoComplete table.
 
Unfortunately, AutoComplete (nifty as it is) makes for better demo than it does real use. It is what it is, and it's all that it is (or ever will be).
 
The VFP team, brilliant as they are IMO, botched this one up.

1)Sometimes when a users selects an entry from the drop down list that is more than 30 characters a duplicate record with that entry is added to the list?....
They must have an index somewhere but I don't know where it is stored.

Modify the table...

Once created by your form, modify the structure. There is an index (same name as the table) ,it is where the table is saved. the Tag name is DATA,The index expression is:

UPPER(source+LEFT(data,30))+PADL(count,8)
LEFT(data,30)) = is your problem.

Reduce the size of the data field to say a 100. As long as the combined width of the 3 fields (in the data expression) are not greater than 240.

Change the Index expression to:
UPPER(source)+alltrim(upper(data))+PADL(count,8)
this will take care of your duplicate problem.

2)Is there any way short of making the AutoCompleteTable read-only to prevent some users from adding to the the list of entries when they type unlisted text in the field?

I dont think you can open this table ReadOnly. Though there are other ways of doing this. We do it in our app, but it uses a combobobox (dropdown list) and is based upon permissions....

Again: This is to give you an idea, you will have to fine tune...
 
Thanks for your help. Changing the index statement solved my problem. I forgot about the Index tab on the Table Designer screen as I always create indexes by coding.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top