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 / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

non-function of cbo 'notinlist'

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
richaluft@cs.com - 15 Jul 2007 20:30 GMT
Hi;
Second time I'm asking this question, and hope someone can suggest a
cure.
I'm running a form with a cbo box for data entry. I have 5 other
BASICALLY IDENTICAL cbo's on the form, all of which work fine.
My NotOnList event is as follows:

   ' Add a new policy type by typing a name in
   ' CoPolicy Type  combo box.

   Dim NewCoPolicyType As Integer, TruncateName As Integer, Title As
String, MsgDialog As Integer
   Const MB_OK = 0
   Const MB_YESNO = 4
   Const MB_ICONQUESTIONMARK = 32
   Const MB_ICONEXCLAMATION = 64
   Const MB_DEFBUTTON1 = 0, IDYES = 6, IDNO = 7
   ' Display message box asking if user wants to add a
   ' new insurer.
   Title = "Policy Type Not In List"
   MsgDialog = MB_YESNO + MB_ICONQUESTIONMARK + MB_DEFBUTTON1
   NewCoPolicyType = MsgBox("Do you want to add a new Policy Type?",
MsgDialog, Title)

   If NewCoPolicyType = IDYES Then

       '  Open Add Policy form.
       DoCmd.OpenForm FormName:="FPolicyTypeCo", DataMode:=acAdd,
WindowMode:=acDialog, openargs:=NewData
       '  Continue without displaying default error message.
       Response = acDataErrAdded

   End If
End Sub

When THIS PARTICULAR NotInList event fires, I am find that:
1)the cbo is not cleared of the newdata entry as the dialogue form
opens (as it does on all my other cbo's). Note, however, that the
openargs ARE properly carried to the dialogue form.
2)When the dialogue form is closed, my cbo is blank, and I get errmsg
of "item not in list".

Can anyone make any sense of why this is happening on only one of six
cbos, and  any solution you can recommend.
TIA, Richard
tricky300 - 16 Jul 2007 00:44 GMT
Just a thought...

Does this combo have the 'limit to list' property set to 'yes' where all the
others are set to 'no'

> Hi;
> Second time I'm asking this question, and hope someone can suggest a
[quoted text clipped - 41 lines]
> cbos, and  any solution you can recommend.
> TIA, Richard
richaluft@cs.com - 16 Jul 2007 02:16 GMT
On Jul 15, 7:44 pm, tricky300 <tricky...@discussions.microsoft.com>
wrote:
> Just a thought...
>
[quoted text clipped - 47 lines]
> > cbos, and  any solution you can recommend.
> > TIA, Richard

No, all of cbo's are functionally identical, with 'limit to list' set
to yes.
Graham Mandeno - 17 Jul 2007 22:31 GMT
Hi Richard

You said in the other thread that:
"the recordsource table for data is also not being updated with new data"

Do you mean that the table on which your combo's RowSource is based is not
getting a new record added with the new policy type?

If so, then the fault is with the form that should be adding that record
(FPolicyTypeCo).  If it is not successfully adding a new record to your
RowSource, with a text field exactly matching NewData then you will get the
"item not in list" message.

Just to clarify:
   acDataErrContinue means "assume this error has been handled and pass
control back to the user interface (but don't let me leave this combo box if
the error has not been rectified)"
and
   acDataErrAdded means "I have added a new row to the data source which
matches what the user entered, so requery it and IF everything is OK then
quit bugging me"
Signature

Good Luck  :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

> Hi;
> Second time I'm asking this question, and hope someone can suggest a
[quoted text clipped - 41 lines]
> cbos, and  any solution you can recommend.
> TIA, Richard
 
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.