adding new entry to combo boxes

janed

Registered User.
Local time
Today, 22:23
Joined
Feb 6, 2002
Messages
60
a few weeks ago i asked if anyone knew how to add an item that wasn't on the list of a combo box to be added to the list. simon c wrote back and gave me a basic code that worked. however, if i enter an item that is not on the list it asks me do i want to add it, which is exactly what i do want to do, but when i press ok Microsoft Access sends a message saying that the item i entered isnt on the list and that i must enter an item from the list. this kind of contradicts my pressing ok. any ideas?
 
You can use code that, upon receiving an error, will bypass the system message you're receiving. Put this code in the 'On Error' event of your form. A message box should show if you get an error. The message box will give the error number. Then you can edit the code to bypass the error. Let me know if you need more help.


MsgBox DataErr 'Use this to detect which error number to block.
If DataErr = 2237 Then 'If gives some stupid error message number 2237
Response = acDataErrContinue 'Don't show it
Else 'If it is any other error
Response = acDataErrDisplay 'Show it
End If

-Mark
 
i am not sure how to hide the message box that tells you the error number. could you help?
 
I think that MsgBox was just to show Accessable what error he was hunting for. Remove that line of the code and see what happens.

David R
 

Users who are viewing this thread

Back
Top Bottom