i have ComboBox controls with multiple columns as a Row Source in an Access 2007 form. i'm currently getting the selected values out of each ComboBox item this way...
value = ComboBoxName.Column(i) 'where i is the index.
i would like to use the actual names of the columns as with Recordset's...
value = ComboBoxName.Recordset.Fields("columnname")
(please note that this does not work properly on the Recordset's of the ComboBox'es: it only works AFTER the first time the ComboBox is changed)
my questions:
- can i do something to "make this work" on a ComboBox's Recordset?:
value = ComboBoxName.Recordset.Fields("columnname")
is there a method that directly gets the value of the selected record using the name ?
does the ComboBox or it's Recordset have a method i can use to get a column index by specifying a column name ?
i would like to avoid writing a function and i don't feel comfortable specifying column indices which may change in the future.