Link to home
Start Free TrialLog in
Avatar of Vrtnar
Vrtnar

asked on

select dbedit text depening on edit text

I have linked dbedit to a datasource and a field.
How can I have dbedit showing text from the database depending on edit text?
example:
In the database I have
field1   field2      
(field1 has same text as edit)
(field2 is linked to dbedit)
So after my table opens if edit text = field1.text then dbedit.text = field2
However I do not want to replace edit with dbedit
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

reformat your query to something like this:

Query1.SQL.Text := 'SELECT FIELD2 FROM TABLE WHERE FIELD1 = ' + QuotedStr(Edit1.Text);
Avatar of Vrtnar
Vrtnar

ASKER

But how do I display FIELD2 in my dbedit ??
set the dbEdit's datafield to field2.
Avatar of Vrtnar

ASKER

and if i have a couple of dbedits to change that way,what would be rigt?
You set the DataField property tothe field in the dataset that you want to show in the DBEdit.
Avatar of Vrtnar

ASKER

edits are not the same...
I don't understand what you mean or what you want to do, here.
Avatar of Vrtnar

ASKER

I have 10 edits that contain various text.
I have a table that contains the same texts from each edit and a percentage value for each entry.
Easy way would be to use dbedits to represent the table but instead i must use plain edit.
So next to edits I placed dbeditst to get the percentage.
So how can I filter them according to edittext

ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin