Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2008

Tip: Looking for answers? Try searching our database.

Not In List

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Doc - 20 May 2008 20:11 GMT
With a field set as combo box, the option exists for a "Not In List" event.  
I wrote some code to pop up a message, but when the user closes the message,
the generic access error message also pops up.

How do I stop that from happening?
Douglas J. Steele - 20 May 2008 20:49 GMT
You need to ensure that you're setting the value of Response properly in the
NotInList routine. Valid values are:

acDataErrDisplay:  The Default value, which displays the default message to
the user.

acDataErrContinue: Doesn't display the default message to the user. You can
use this when you want to display a custom message to the user.

acDataErrAdded:  Doesn't display a message to the user but enables you to
add the entry to the combo box list in the NotInList event procedure. After
the entry is added, Microsoft Access updates the list by requerying the
combo box. Microsoft Access then rechecks the string against the combo box
list, and saves the value in the NewData argument in the field the combo box
is bound to. If the string is not in the list, then Microsoft Access
displays an error message.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> With a field set as combo box, the option exists for a "Not In List"
> event.
[quoted text clipped - 3 lines]
>
> How do I stop that from happening?
Doc - 21 May 2008 19:17 GMT
Oh man, I don't have a clue what that means. . .

Are you saying I need to put that in the NotInList box, or include it
somewhere in the function I wrote?

> You need to ensure that you're setting the value of Response properly in the
> NotInList routine. Valid values are:
[quoted text clipped - 20 lines]
> >
> > How do I stop that from happening?
Douglas J. Steele - 21 May 2008 19:52 GMT
What do you currently have for the NotInList event?

Assuming it's a Event Procedure, it's probably something like:

Private Sub MyCombo_NotInList(NewData As String, Response As Integer)

 MsgBox "Hey, that's not a good value!"

End Sub

You need to change that to

Private Sub MyCombo_NotInList(NewData As String, Response As Integer)

 MsgBox "Hey, that's not a good value!"
 Response = acDataErrContinue

End Sub

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Oh man, I don't have a clue what that means. . .
>
[quoted text clipped - 30 lines]
>> >
>> > How do I stop that from happening?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.