PDA

Click to See Complete Forum and Search --> : list boxes


gilly
Jun 12th, 2000, 05:03 PM
Im a trainee programmer and have been given a V.B database project. The only problem is that I don't know how to link listboxes to databases!! Please help me so that I can get a job!!!

Ianpbaker
Jun 12th, 2000, 07:23 PM
Hi gilly

There are two ways you can get a list box to connect to a database.

One.

You can make a ADO/DAO data control and bind the list box to it using the datamember and datasource properties of the list box.

Two.

you can create a recordset at runtime and populate it throught code.

Mylistbox.Clear
While Not Myrecordset.EOF
Mylistbox.AddItem Myrecordset("MyField")
Wend

Either way you get the same affect

Hope this helps

Ian

gilly
Jun 12th, 2000, 08:21 PM
Thank-you for your help. My chances of employment are not looking so bleak now!!!!!!