Limiting List in a Combo Box, while showing values not in it.

  • Thread starter Thread starter Andy Chicas
  • Start date Start date
A

Andy Chicas

I currently have a table with three values in it.

"Open", "Closed", and "Queued for Closing."

I want the users to only have the ability to choose "Open"
and "Queued for Closing," but I want them to be able to
see "Closed."

So if a record came up that was "closed" the combo box
would show "Closed," but if the drop down arrow was
clicked, only "Open" and "Queued for Closing" would show
up.

I hope my explanation makes sense.

Any help would be appreciated. Thanks!

- Andy
 
So if a record came up that was "closed" the combo box
would show "Closed," but if the drop down arrow was
clicked, only "Open" and "Queued for Closing" would show
up.

I'd leave the combo's rowsource alone and just trap the change in the
combo's BeforeUpdate event:

Private Sub combobox_BeforeUpdate(Cancel as Integer)
If Me!combobox = "Closed" Then
Cancel = True
Me!combobox.Undo
End Sub

If the user selects Closed the field will not be updated and the combo
will revert to its prior state. You can put in a Msgbox call if you
want to warn them what's happening.
 
Back
Top