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

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
 
J

John Vinson

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.
 

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