?
Solved

dbLookUpComboBox

Posted on 1999-01-26
3
Medium Priority
?
1,084 Views
Last Modified: 2012-08-13
Hi,
I have a dbLookUpComboBox and when an item has been selected I want to clear the combobox. How do I do that?
0
Comment
Question by:svenj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:Oli2
ID: 1363349
use the OnChange Event.

procedure dbComboBox.Change ( Sender: TObject );
var x: Integer;
begin
 if dbComboBox.ItemIndex <> -1 then
 dbComboBox.Items.Clear;
end;

Greetings, Oli
0
 

Author Comment

by:svenj
ID: 1363350
Hi Oli2,
I have a DBLookUpComboBox and that solution dosn't work for it.

// svenj
0
 
LVL 3

Accepted Solution

by:
d4jaj1 earned 20 total points
ID: 1363351
I don't think you can 'remove' teh items because it's a lookup combobox.  Teh combobox is always connected to teh table - thus there will ALWAYS be values.  There are two options;

1) remove the dataset/table property from the control.  Not to good, since the control would be blank and probably inactive.

2)  Instead of using a dbLookup, us a Tquery or a FOR loop to fill the values of a regular combobox, then use teh code above.

Logic (not code)

1) Execute Query to add for unquie values to combobox or perform For loop on lookup table to add values to combobox
2) Save the vales to a TStringList
3) Add teh values from teh StringList to the control.  You can add and remove some or all of the values as you see fit, e.g., when teh user makes a selection.

Any questions, please ask.

Jay
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question