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";
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.
All Our Microsoft Access Products