Solved

NotInList Not working properly

Posted on 2013-11-05
5
308 Views
Last Modified: 2013-11-05
I have a combo box on my form with the "NotInList" event firing this code:

    If MsgBox("Do you want to add this OWNER to the list?", vbYesNo) = vbYes Then
        DoCmd.OpenForm "frmOwnerAdd", , , , acFormAdd, acDialog, NewData
        Response = acDataErrAdded
    Else
        Response = acDataErrContinue
    End If

Open in new window


I've used this code many times in the past but for some reason after they close the pop-up form to enter the new owner into the table I get the "The text you entered isn't an item in the list" error. Then when you open the pull down on the combo you can clearly see that entry in the list. I have other databases that use this exact function and work fine. The combo box is bound to column 1 which is a "number" datatype. What also happens is after you click ok on the error message and then select the new entry from the pull down list and then tab out of that control the field goes blank but when you close and open the form the value is there. Something funky is going on and I can't figure it out. What am I missing?
0
Comment
Question by:Lawrence Salvucci
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39623970
Your code and method seem to be working fine for me.  The issue might be in your dialog box rather than the code you posted here.

Can you post a sample database with just the relevant forms/queries/tables showing this issue?  Strip it of any sensitive data or features before posting it.
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39623996
I don't see anything wrong either.   I would do a /decompile first (which is a command line switch).

That will cleanout the compiled code (do a backup first).  Also do a compile and make sure your error free after that.

Details can be found here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_2043-Decompile-What-it-is-what-it-does-and-how-to-use-it.html

Jim.
0
 
LVL 57
ID: 39623997
BTW, what's the rowsource of the combo?  Query/table or SQL statement your building on the fly?

Jim.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39624233
what version of access are you using?
0
 
LVL 1

Author Comment

by:Lawrence Salvucci
ID: 39626022
Sorry for the delay in posting back. I did a /decompile and that worked. Something must have been getting hung up somewhere but all is well now. Thank you for the quick responses.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question