On Not In List

Mile-O

Back once again...
Local time
Today, 20:49
Joined
Dec 10, 2002
Messages
11,305
I'm trying to use this property for the first time.

I have a combo box that lists the months January through December.

I just want to make sure that nobody can type anything else into the combo box.

Limit To List is set to Yes.

I thought that if I restored the value that was in the combobox before the user tried to imagine a new month then I could capture that - my code now restores the month's name if overtyped. However, I still get The value you have entered is not in the list."

Any suggestions round this?
 
Last edited:
You could try something like this, on the got focus event you could set the value from the combo box to a modular level variable. The on the not in list event you could change it back to the modular variable.

I think you are still going to get that message though but you could set it back to the original value.
 
Use the NotInList event to handle the error
 
Sorry, chenn but I want to get rid of the message.

To Rich, can you further elaborate as Access doesn't seem to treat this message as an error rendering it untrappable (in my eyes!)
 
Private Sub MusicCategoryID_NotInList(NewData As String, Response As Integer)
Me.Undo
Response = acDataErrContinue
End Sub
 

Users who are viewing this thread

Back
Top Bottom