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 / January 2006

Tip: Looking for answers? Try searching our database.

not in list access error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
scotbcb - 18 Jan 2006 15:15 GMT
I have code to call a form to input data when it is not already in the table
underneath and appearing in the combo box. I have an intermittent problem of
the code runs and opens the form to input the new details but also sometimes
the default microsoft access error dialogue box appears for value not in
list. How do I stop this happening?
Douglas J Steele - 18 Jan 2006 15:21 GMT
What does your code look like? Are you remembering to set Response =
acDataErrAdded?

Signature

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

> I have code to call a form to input data when it is not already in the table
> underneath and appearing in the combo box. I have an intermittent problem of
> the code runs and opens the form to input the new details but also sometimes
> the default microsoft access error dialogue box appears for value not in
> list. How do I stop this happening?
scotbcb - 18 Jan 2006 16:42 GMT
Douglas below is the code for the notinevent for the combo box, the combo box
is in a subform on the main form. the subform record source is a table and
the combo box record souirce is a query.

Dim Msg, Style, Title                                          ' Declare
Variables
     
   Msg = "Do you wish to add a new Individual Name?"              ' Define
message.

   Style = vbYesNo + vbCritical + vbDefaultButton1                ' Define
buttons.
   
   Title = "Individual Name"                                      ' Define
title.

   Response = MsgBox(Msg, Style, Title)                           ' Display
Message
   
   If Response = vbYes Then
       DoCmd.OpenForm "frm_individual_name_new", , , , acFormAdd, acDialog,
NewData
       Response = acDataErrAdded                                  'combo
automatically requeried
   Else
       Response = acDataErrContinue
       Me.Undo
   End If

> What does your code look like? Are you remembering to set Response =
> acDataErrAdded?
[quoted text clipped - 7 lines]
> > the default microsoft access error dialogue box appears for value not in
> > list. How do I stop this happening?
Douglas J Steele - 18 Jan 2006 21:30 GMT
Try putting a Requery of your combobox after you return from the call to the
form.

Signature

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

> Douglas below is the code for the notinevent for the combo box, the combo box
> is in a subform on the main form. the subform record source is a table and
[quoted text clipped - 36 lines]
> > > the default microsoft access error dialogue box appears for value not in
> > > list. How do I stop this happening?
Roger Carlson - 18 Jan 2006 15:34 GMT
On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "NotInList.mdb" which does this.  Perhaps if you compared my
application to yours, you'll see a difference.  Also, there is one called
"NotInListAlternative.mdb" which does not rely on the Not In List event.

Signature

--Roger Carlson
 MS Access MVP
 Access Database Samples: www.rogersaccesslibrary.com
 Want answers to your Access questions in your Email?
 Free subscription:
 http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L

> I have code to call a form to input data when it is not already in the table
> underneath and appearing in the combo box. I have an intermittent problem of
> the code runs and opens the form to input the new details but also sometimes
> the default microsoft access error dialogue box appears for value not in
> list. How do I stop this 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.