Solved

All selected in TBLookupListBox?

Posted on 1998-12-11
6
137 Views
Last Modified: 2010-04-04
When I single click in the TBLookupListBox control, all the items are selected, and I cannot prevent or alter this.

I am using Delphi 3 Standard.

How can I just have one item selected?
0
Comment
Question by:Chrism
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Hi Chrism,

I just tried to replicate your error, but I've no problem.

Can you show some source or handlings?

Zif.
0
 

Expert Comment

by:elkiors
Comment Utility
Show us how you've set up the lookup criteria. Are you using persistant fields.?

Have you got multiple select set to false?

Darren
0
 
LVL 2

Author Comment

by:Chrism
Comment Utility
There is no source involved with this item...as soon as I put the control on the form and connected the source, when I ran the program, I got this problem?

I do not know if I am using persistent fields (sorry), and I have not set MultiSelect anywhere.

The only things I have set that might be of interest are:

Datafield and DataSource are both blank.
KeyField = Inv_ID
ListField = Inv_Line_Desc
ListFieldIndex = 0
ListSource = Inv_Lines
ReadOnly = False

I have not set any other properties, but I will test anything suggested at this stage!
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Chrism,

I tried it with BioLife table from DBDemos :

ListSource = DataSource1 (DataSource1 is attached to table1, with table1 set to biolife table. Active = True)

KeyField : Species No
ListField : Species Name
ListFieldIndex : 0
ReadOnly : False

it works perfectly.

Regards, Zif.
0
 
LVL 2

Author Comment

by:Chrism
Comment Utility
Um..err...I am suitably embarrassed.

Thankyou for your persistance Zif, although your response did not solve the problem exactly, it indicated to me what the problem was. (and it all makes perfect sense now)

Because the KeyField was set to a foreign key, the way the listbox was set up was that every element in the listbox had the same value as in KeyField, therefore, when one was selected, all items were highlighted.

Please repost as an answer, as it was your persistance that got me through my stupidity.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
Comment Utility
Hi Chrism,

Glad the problem is gone. Well, I think everybody has of these days.

Regards, Zif.

------
Chrism,

I tried it with BioLife table from DBDemos :

ListSource = DataSource1 (DataSource1 is attached to table1, with table1 set to biolife table. Active = True)

KeyField : Species No
ListField : Species Name
ListFieldIndex : 0
ReadOnly : False

it works perfectly.

Regards, Zif.

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now