I have a Modal Form where the data entry/edit fields are populated (in code on form load) from the record/row selected and passed as a parameter from a bound DataGridView control on the parent form.
All data fields populate as I require. However there is a data field/item 'codecolour' which I do not want displayed I want the 'Colour Description' hence the use of the ComboBox. I want to give the ComboBox the data value 'ColourCode' and expect the ComboBox to display the 'Colour Description'. All is working great with the exception of my ComboBox values.
The combobox is bound to a lookup table Colours with fields 'ColourCode' and 'Colour Description'
I have the ComboBox working fine for Adding a Record, user selects the Colour via Description and the colour code is correctly provided back for saving in the table. When Editing a record I need the reverse to occur when presenting the data to the user, i.e. somehow give the colourcode value to the combobox and have it automatically lookup the colour table and display the colour description. I want to stress that none of the fields on the child/modal form are bound fields, I am processing them unbound which is what I want. (The ComboBox is bound to the lookup table to show list of possible values.
Seems a simple thing to want to do, but I have spent so much time trying to get it to work, must be missing something. Any help appreciated.
cheers
All data fields populate as I require. However there is a data field/item 'codecolour' which I do not want displayed I want the 'Colour Description' hence the use of the ComboBox. I want to give the ComboBox the data value 'ColourCode' and expect the ComboBox to display the 'Colour Description'. All is working great with the exception of my ComboBox values.
The combobox is bound to a lookup table Colours with fields 'ColourCode' and 'Colour Description'
I have the ComboBox working fine for Adding a Record, user selects the Colour via Description and the colour code is correctly provided back for saving in the table. When Editing a record I need the reverse to occur when presenting the data to the user, i.e. somehow give the colourcode value to the combobox and have it automatically lookup the colour table and display the colour description. I want to stress that none of the fields on the child/modal form are bound fields, I am processing them unbound which is what I want. (The ComboBox is bound to the lookup table to show list of possible values.
Seems a simple thing to want to do, but I have spent so much time trying to get it to work, must be missing something. Any help appreciated.
cheers