Unbound ComboBox initial display

  • Thread starter Thread starter Lara
  • Start date Start date
L

Lara

When a form opens, I want an unbound combo box to
automatically select a particular item from the list
(such as the one that matches the value in another
field), then allow the user to change that selection. My
VBA for Access is more than a little weak! How do I do
this?
 
If you want the combo box to be set to a certain row, you could use the column property.

Me.cboMyCombo = Me.cboMyCombo(0,1)

This would set the value of the combo box to the value in column 1, row 2 (the numbers are
zero based). The column you pick should be the bound column number -1.

To set the combo box to the value of another control

Me.cboMyCombo = Me.txtMyTextbox

To do this each time you move from one record to another, you would do this in the Form's
OnCurrent event.
 
Back
Top