Solved

ListBox as Database Navigator

Posted on 1997-04-17
4
281 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
  • 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 50 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

20 Experts available now in Live!

Get 1:1 Help Now