Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ListBox as Database Navigator

Posted on 1997-04-17
4
Medium Priority
?
288 Views
Last Modified: 2010-04-04
How can I put a listbox on a form that shows the value of a specific field all records deep?

How can I make clicks on this ListBox navigate in the database?

I want this ListBox to change if I change the database.

Can it be done at all?
0
Comment
Question by:alona041797
[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
  • 2
4 Comments
 
LVL 2

Expert Comment

by:javiertb
ID: 1335441
Isn't it what you're trying to do just a single dbgrid with only one field in the Fields Editor??
0
 

Expert Comment

by:sholmes
ID: 1335442
This is a suggestion seeing that I really have no clue what you are attempting.  It seems to me though that you could accomplish this by making a DBGrid pretend to be a ListBox.  Set the grid up so that the DBGrid displays only one field, the field you are interested in.  Set its width accordingly. You could also get rid of the grid lines, etc.  You would think it was a list box when it was done.  Let me know if this is what your after and I can help.

Other words, check this out.

Add records to listbox

with Table1 do
begin
while not EOF do
begin
 ListBox1.Items.add(fields[0].asString);
end;
end;


now, in you listbox onClick event you can reference the item using ListBox.Items[ListBox.ItemIndex]

Use this string to perform a search and place the cursor on the
record.

There would be some table functions and maybe some sql's here, however, it could be done.



0
 
LVL 2

Author Comment

by:alona041797
ID: 1335443
Yes. This is what I'm after, please elaborate more and ANSWER the question instead of just COMMENTing on it.
0
 
LVL 2

Accepted Solution

by:
javiertb earned 150 total points
ID: 1335444
I think that's what I told before sholmes. But it'll be really slow if you try to navigate through the database using a search for each record you move to. Definately it's very slow. Just use a DBGrid, make it appear however you want and make it show only one record by means of its editor. This way you'll be able to move through the database just as if you had a listbox.
If you really need a more elaborated answer let me know, but I think there's not too much to elaborate here.

Hope this help
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

715 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