Update combo box

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
 
W

Wayne Morgan

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
 
P

Phil

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
 
W

Wayne Morgan

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top