changing Combo Box dispalyed value

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have a table that list job records, about 6,000 entries in the form below

JobRec Customer
1 ABC
2 BCD
3 CDE
4 DEF
etc

I have a form with a combo box that displays the JobRec that will then
display the info for the job number in the various fields of the form.
I have a navigation button to increment the JobRec by one so that I can move
through the records and update the fields on the form and this works fine.
I would like the displayed value in the combo box to match the current
record being displayed.
I can get the ListIndex from the combo box and it will be for example 2, if
I increment this by one I would like to then set the combo box displayed
value to 3.
ListIndex is however, read only so me.combo3.listindex+1 does not work.

Is it possible to have the combo box displayed value track the record number
being incremented by the navigation button?
 
Hi Tom

You can set ListIndex in code provided the listbox or combobox has the
focus. So:

With Me.combo3
.SetFocus
If .ListIndex < .ListCount - 1 Then
.ListIndex = .ListIndex + 1
End If
End With
 

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

Similar Threads

E-mail Excel worksheet based upon selection of combo box 1
Combo box question 7
Change displayed combo box value using VBA 4
Combo Box 3
combo box filter 1
Combo Box Help 7
Combo Box Question 4
Combo Boxes 1

Back
Top