Link to home
Start Free TrialLog in
Avatar of learn
learn

asked on

How to use DBList?

Too simple, but tell me how to display a field in a DBList in VB5 with Data1.
Avatar of Valetudo
Valetudo

DBList1.DataField = Data1.RecordSource name_field
Avatar of learn

ASKER

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.
1. Make sure you are using DbList and not the list
2. set the listfield at design time or on the fly

'Wayne
Listfield is a propery of DBList
Avatar of learn

ASKER

To  Juilette:

Thank you.

I haven't set the property Listfield in design time.....What is that?
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
Avatar of learn

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Juilette
Juilette

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of learn

ASKER

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.
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
Did it work?
Avatar of learn

ASKER

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.
Avatar of learn

ASKER

I will give the points to Juilette since his answer is what I need.
Avatar of learn

ASKER

Juilette,

Sorry for the delay.
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.