Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox question

Status
Not open for further replies.

Imbriani

Programmer
Jan 9, 2004
195
US
Hi guys,

Here's the dumb question of the day. I work with VB 6.0 off and on and sometimes can't remember the simplest of things after months pass. I have an established application pulling from a MS Access database. I have added a field to the DB and want to add a simple listbox to the form to fill this field from now on. It has three choices, A, S, and F (letters). I can't get the data to show up in the database when I try it out. The source is the entire database, so there's no sql involved. I'm thinking this is something unique to the listbox, as a text box will work. What dumb thing have I done?????
 
As a test, I created a new form and put only the text box for the new field on it, entered some data and Voila, it went into the database! So I know the DB will accept the data, just not from the listbox, apparently. Since the application and DB were already set up before I added the field and list box, does that have some meaning? I ID'd the list box as being connected to the new field in the DataField section of the properties list for the listbox.
 
You'll need to also set the BoundColumn property if the DataList
 


Imbriani, if you are not using the DataList control, but instead the simple ListBox, then you will need to update the data by updating the DataControl's recordset field when the ListBox's Validate event fires.

If you use the DataList(ADODB), or DBList(DAO) bound control listbox, and set the binding properties, it will update automatically.

Andrzejek, it looks they are binding the textbox to a datacontrol's recordset field, and trying to do the same with the simple list control, I suppose, which will only read the data into the list, and not update the field as with the DataList\DBList control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top