Update combo box

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Hi,

I added a combo box to a form to aid in finding a
different record. When an item is selected from the combo
box the form fields are changed to the record selected.
If I change records using the navigation buttons (or
the "find" icon) the combo box is not changed to the new
record. How do I update the data in the combo box when
there is a change in record? Showing different data in
the fields would be confusing for the user.

Thanks,
Phil
 
In the Current event of the Form, set the value of the combo box as desired.
You would probably use the same field you are currently using to move to the
record in the form when you change the combo box. If you're at a new record,
set the combo box to Null.

If Me.NewRecord Then
Me.cboMyCombo = Null
Else
Me.cboMyCombo = Me.txtMyTextbox
End If
 
Thanks Wayne for responding

My combo box is still blank. If I trace the code the
Me.cboMyCombo (in my case it is cboFindPerson) receives
the name I want in it, but when I continue the combo field
is still empty. Do I need code to make the combo box go
to the record I am now on?

Thanks,
Phil
 
Is there more than one column in the combo box? If so, are you sending it a
value that would be valid for the Bound Column?
 
Back
Top