Combo show list from code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Within code, is there a way to open a combo box list to show entries up to
the limit set similar to how Access handles NotInListEvent? This event, if
left to default where Limit to List is set to 'Yes', will put out standard
error message but then, open the current list. What code opens this list up?

Thanks.
 
Thanks Klatuu but I did try the Dropdown method but nothing happened - I
could still only see Combo text field (no drop down list) - The After Update
code below :-

If Me.Combo8.ListIndex = -1 Then
MsgBox "Name supplied is not in list"
Me.Combo8.ForeColor = vbRed
Me.Combo8.Dropdown
GoTo Exit_Combo8_AfterUpdate
Else
Me.Combo8.ForeColor = vbBlack
End If

....
 
Andy said:
Thanks Klatuu but I did try the Dropdown method but nothing happened - I
could still only see Combo text field (no drop down list) - The After Update
code below :-

If Me.Combo8.ListIndex = -1 Then
MsgBox "Name supplied is not in list"
Me.Combo8.ForeColor = vbRed
Me.Combo8.Dropdown
GoTo Exit_Combo8_AfterUpdate
Else
Me.Combo8.ForeColor = vbBlack
End If


That's because the focus is moving to another control and
the DropDown only means something while the combo box has
the focus.

Move your code to the BeforeUpdate event and add:
Cancel = True
after the DropDown line.
 
Back
Top