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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
JuiletteConnect With a Mentor Commented:
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
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
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
 
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
All Courses

From novice to tech pro — start learning today.