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
Delphi

Avatar of undefined
Last Comment
Computer101
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 ??
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

set the dbEdit's datafield to field2.
Avatar of Vrtnar
Vrtnar

ASKER

and if i have a couple of dbedits to change that way,what would be rigt?
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

You set the DataField property tothe field in the dataset that you want to show in the DBEdit.
Avatar of Vrtnar
Vrtnar

ASKER

edits are not the same...
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

I don't understand what you mean or what you want to do, here.
Avatar of Vrtnar
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Computer101
Computer101
Flag of United States of America image

Forced accept.

Computer101
EE Admin
Delphi
Delphi

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

60K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo