ComboBox Data Binding and Case Sensitivity

Provided by Dave Juth, Senior System Architect

The ValueMember property of the Combo Box allows users to set the binding column of the combo box. The .ValueMember property of a ComboBox is case sensitive. If you mis-type the column name, or type the correct column name with the wrong case for this property your code will throw an exception, "Could not bind to the new value member." Without knowing that this is a likely cause of the exception, this can be very difficult to track down.  

An example: if the value column is named "EmployeeId" and you use "EmployeeID," this will trigger the error:

comboBoxEmployee.DataSource = dtEmployee;

comboBoxEmployee.DisplayMember = "Name";

comboBoxEmployee.ValueMember = "EmployeeID";


Additional Resources

 

 

Thank you! Thank you! I just finished reading this document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.

Darren D.


View all FMS products for Microsoft Access All Our Microsoft Access Products

 

 

Free Product Catalog from FMS