Combo Box column

  • Thread starter Thread starter Paul Hammond
  • Start date Start date
P

Paul Hammond

How do I select the value in a non bound column of a
combo box. I know how to do it in VBA but not as an
expression. I could assign that value to a text box
too, but I'd rather reference the column directly. Is
there a way to do this?

Paul Hammond
Richmond, VA
 
Queries cannot "see" any column in a combo box or list box except the bound
column (because the bound column is the value of that control).

Create a public function that gets the value of the column you want and
returns it to the query. For example, in your query, replace the
[Forms]![frm-Name]![combo1].[column(3)] reference with this:

GetMyColumnValue()

Create a public function in a regular module (name the module basFunction):

Public Function GetMyColumnValue(lngColumnNumber As Long) As Variant
GetMyColumnValue = Forms]![FormName]![ComboboxName].Column(1)
End Function


The above example will get the value of the second column.
 
Back
Top