How to use DBList?

Too simple, but tell me how to display a field in a DBList in VB5 with Data1.
learnAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ValetudoCommented:
DBList1.DataField = Data1.RecordSource name_field
0
learnAuthor Commented:
Hi Valetudo,

I have set following properties in design time:
databasename, recordsource for data1
datasource, datafield for dblist1
but nothing I can see in dblist1 during run time.
0
JuiletteCommented:
1. Make sure you are using DbList and not the list
2. set the listfield at design time or on the fly

'Wayne
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

JuiletteCommented:
Listfield is a propery of DBList
0
learnAuthor Commented:
To  Juilette:

Thank you.

I haven't set the property Listfield in design time.....What is that?
0
JuiletteCommented:
If you have a DBList Box and not a Listbox just go to your DBlist box and click on it to select it. Press f4 to bring up the properties box. Look down the list for ListField...when you click on it if you have your db and rs and all the rest selected it will open up and show you all the field names in your data base...you then select a field to display in your list box.

Wayne
0
learnAuthor Commented:
To Juilette:

1. I am 100% sure that I got a DBList from project-components...
2. I have set the field of the database to the property "DataField" for DBList1. Is that wrong? Do I need to cancel it and set another property "ListField"?

Cheers.
0
JuiletteCommented:
On your datacontrol you set
databasename
recordsource properties...this will be one of the fields in your db

On the dbList you set
Rowsource...this is your datacontrol
Listfield..this is a field in your db.

Wayne

Ps..Wayne's the name  Juliette is the sign on.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
learnAuthor Commented:
Hi Wayne,

Did you say the properties DataSource and DataField in a DBList are rubish and they have been replaced by RowSource and ListField!? So why they still in the property list of a DBList Box?

Best regards.
0
JuiletteCommented:
I wouldn't say replace, I'm sure they have a use. Who knows..all I know is how to make it work...I've used the dblist box but it was some time ago..so I built a little example and tested it to see if that was what you needed and using only what I gave you i listed a field in the listbox.

Wayne
0
JuiletteCommented:
Did it work?
0
learnAuthor Commented:
Hi Wayne,

1. It is working! (set properties RowSource and ListField....but why RowSource....strange.)
2. Properties DataSource and DataField may be used for automaticaly highlighting the current record moved by Data1.
3. However, when a user click DBList1 and then click the arrow box of Data1, error may be caused!!

Cheers.
0
learnAuthor Commented:
I will give the points to Juilette since his answer is what I need.
0
learnAuthor Commented:
Juilette,

Sorry for the delay.
0
JuiletteCommented:
Thank you..
I set the data1.visible = false..you don't need to see it as it really has no visible use with the listbox.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.