>I need to make a combobox with 2 columns, both populated by fields from the same view. There will be a method that uses the value from the 1st column to search for records.
>
>1. How do I make the fields show up in the combo?
On initial opening of the view, make certain to use the NoDataOnLoad option. Change the ComboBox properties; make ColumnCount = 2, ColumnWidths to a comma delimited string giving the width of each Column eg '69,42', RowSourceType = 6 (Fields), RowSource a comma-delimited string in the form '
ViewAlias.Field1,Field2', and BoundColumn = 1. When the ComboBox gets focus, set the View parameter, and issue a Requery(). Initialize the DisplayValue to the starting value if necessary; it must at least be the right data type. Makes its own sauce. If the View changes it's values as your form runs, you have to issue a
ComboBox.Requery() to requery the ComboBox's RowSource, which may require updating the view's parameter value first.
>2. How do I address the value in the 1st field in my search code?
name of ComboBox object.Value, which is why you set the BoundColumn, although the default is column 1. The view will have shifted to the record whose value is shown in the ComboBox. The view can have more fields than the number displayed in the ComboBox. If other controls use the same view as their COntrolSource, their COntrolSource will update when a value is selected. If the ComboBox is a control in the grid, don't make the same view driving the grid also referenced as the RowSource - if you need that, open a second instance with a separate name to serve as the ComboBox RowSource.
>
>Thanks
>JD