DDX_FieldLBStringExact
The DDX_FieldLBStringExact function copies the current selection of a list box control in a record view to a CString field data member of a recordset associated with the record view.
void AFXAPI DDX_FieldLBStringExact( CDataExchange* pDX, int nIDC, CString& value, CRecordset* pRecordset ); void AFXAPI DDX_FieldLBStringExact( CDataExchange* pDX, int nIDC, CString& value, CDaoRecordset* pRecordset );
In the reverse direction, this function sets the current selection in the list box to the first row that exactly matches the string specified in value. On a transfer from the recordset to the control, if the recordset field is Null, any selection is removed from the list box. On a transfer from control to recordset, if the control is empty, the recordset field is set to Null.
Use the first version if you are working with the ODBC-based classes. Use the second version if you are working with the DAO-based classes.
For more information about DDX, see Dialog Data Exchange and Validation. For examples and more information about DDX for CRecordView and CDaoRecordView fields, see the article Record Views.
See DDX_FieldText for a general DDX_Field example. Calls to DDX_FieldLBStringExact would be similar.