 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
pcerdaz Guest
|
Posted: Thu Jan 08, 2004 11:06 am Post subject: Automatic text search on a Lookup field of a DBGrid |
|
|
Hi all,
How can I make an automatic text search on a Lookup field of a
DBGrid, for the most identical text between the different
atributes previously created on the Lookup Table?
Any help will be apretiate. Thanks.
Pcerdaz
|
|
| Back to top |
|
 |
Dwayne Guest
|
Posted: Sun Jan 18, 2004 7:22 pm Post subject: Re: Automatic text search on a Lookup field of a DBGrid |
|
|
Hello pcerdaz,
| Quote: | How can I make an automatic text search on a Lookup field of a
DBGrid, for the most identical text between the different
atributes previously created on the Lookup Table?
Any help will be apretiate. Thanks.
Pcerdaz
|
Not sure if I understand your question, but lets start with this...
Table1->Goto Nearest();
Dwayne
|
|
| Back to top |
|
 |
Dwayne Guest
|
Posted: Mon Jan 19, 2004 12:58 am Post subject: Re: Automatic text search on a Lookup field of a DBGrid |
|
|
Hello Pcerdaz,
| Quote: |
Thank you Wayne, but I think that my question was not clear. |
I try again: when the user must to write many text using
DBLookUpComboBox or a DBGrid would be very usefull that the
program complete automatically the entire text with the most
similar founded in the table asociated with these data
controls.
For example, the user write "a" and the program complete with
aPPLE (suposse the other options are LEMON, ORANGE and
PINAPPLE), or the user write "p" and the program complete with
pINAPPLE.
I hope that now my question is clear. If you can help me again I will thank
you.
<<
Ok, you need to Pad your Index or field that you are using.
Easiest to Right Pad.
This is cheap and dirty, and I use it for some of my programs.
This is the pseudo code, but it is extremely close to the original code.
while Edit1 is changing (you can check this off on the Edit Field)
Edit1Change
{
AnsiString Buf1;
Buf1=Edit1 // string you are inputting for automatic completion.
while (Buf1.Length()<(length of the index field))Buf1=Buf1+" "; //Pad to
the right.
Table1->SetKey();
Table1->Fieldbyname("Indexfield")->Text=Buf1;
Table1->GotoNearest();
(From here, you can do a direct compare and see if the data is all there).
if Table1->FieldByName("Indexfield")!=Buf1 then "Pop Window" No more
matches! you ran out of matches.
}
|
|
| Back to top |
|
 |
pcerdaz Guest
|
Posted: Mon Jan 19, 2004 9:28 pm Post subject: Re: Automatic text search on a Lookup field of a DBGrid |
|
|
"Dwayne" <myfrienddr (AT) yahoo (DOT) com> wrote:
| Quote: | Hello pcerdaz,
How can I make an automatic text search on a Lookup field of a
DBGrid, for the most identical text between the different
atributes previously created on the Lookup Table?
Any help will be apretiate. Thanks.
Pcerdaz
Not sure if I understand your question, but lets start with this...
Table1->Goto Nearest();
Dwayne
Thank you Wayne, but I think that my question was not clear. |
I try again: when the user must to write many text using
DBLookUpComboBox or a DBGrid would be very usefull that the
program complete automatically the entire text with the most
similar founded in the table asociated with these data
controls.
For example, the user write "a" and the program complete with
aPPLE (suposse the other options are LEMON, ORANGE and
PINAPPLE), or the user write "p" and the program complete with
pINAPPLE.
I hope that now my question is clear. If you can help me again I will thank you.
|
|
| Back to top |
|
 |
Jayme Jeffman Filho Guest
|
Posted: Tue Jan 20, 2004 1:29 am Post subject: Re: Automatic text search on a Lookup field of a DBGrid |
|
|
Hello pcerdaz,
Try to order the lookup table in alphabetic order.
HTH
Jayme.
"pcerdaz" <pcerdaz (AT) mi (DOT) cl> wrote
| Quote: |
"Dwayne" <myfrienddr (AT) yahoo (DOT) com> wrote:
Hello pcerdaz,
How can I make an automatic text search on a Lookup field of a
DBGrid, for the most identical text between the different
atributes previously created on the Lookup Table?
Any help will be apretiate. Thanks.
Pcerdaz
Not sure if I understand your question, but lets start with this...
Table1->Goto Nearest();
Dwayne
Thank you Wayne, but I think that my question was not clear.
I try again: when the user must to write many text using
DBLookUpComboBox or a DBGrid would be very usefull that the
program complete automatically the entire text with the most
similar founded in the table asociated with these data
controls.
For example, the user write "a" and the program complete with
aPPLE (suposse the other options are LEMON, ORANGE and
PINAPPLE), or the user write "p" and the program complete with
pINAPPLE.
I hope that now my question is clear. If you can help me again I will thank you.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|