2013-06-21

I am trying to create a front end program through Visual Studio 2012 using VB.Net for a database backend (both Access and SQL Server will be used for the backend). What I'm used to in MS Access is that the combo box has a Control Source property which tells it in which field to store the selected value. Then you have a Row Source property that allows you to query a second (related) table for possible values. I then bind the control to the primary key field of the related table, but show the text field. So I have two fields in the combobox, but the column sizes are 0 inches for the first column (makes it a hidden column) and then whatever size is needed to show the data that I want seen.

So far, I have been able to get the text for the list of options by using the DataSource property to list the binding source and then the DisplayMember property to select the field I want shown. I believe that the Text property under the DataBindings group would be the same as the control source in Access, however there are also SelectedItem and SelectedValue properties which I can't figure out what they are for.

I have read about multi-column comboboxes, but I'm not trying to display multiple columns, so I'm not sure if this is the route I need to follow.

Please let me know if my question is unclear.

Show more